Horde3D

Next-Generation Graphics Engine
It is currently 24.11.2024, 19:42

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: 17.07.2008, 15:09 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
I have a setup like this:

Pipeline("forward1") -> Material("mat1") -> Texture("ntex")

1 . Pipeline refers to a material (draws a quad with it).
2 . Materials has a TexUnit with name "ntex"

The texture doesn't actually exists yet when the pipeline is loaded.

I am going to create it only later, because it should be updated dynamically and I don't know its parameters yet. Obviously loading it will fail at first - a warning shows in the log.

What's even more weird: I cannot create that texture later on - it is "in use" or "exists" (shows in the log), even though it was never found in the first place. It can be found as a texture resource with the correct name. Unloading it returns true, no matter how many times I unload it (meaning it's unloaded?). However it cannot be found by querying unloaded resources after unloading (does this mean it's unqueriable by default, and why?).

I need to use that dynamically created texture there. How should I approach tihs problem?


Last edited by cantele on 17.07.2008, 16:07, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: 17.07.2008, 16:06 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
I am trusting that this engine will develop further and so I decided to continue and loaded a dummy TGA to the texture. I find it using resource management functions and start updating it instead of creating the texture dynamically.

This approach, if it worked, renders 'createTexture2D' unusable in nearly all situations where a texture is used in a pipeline.

However, my TGA file had exactly 3 components, and the texture that is automatically created has 4. So, even creating the texture statically does not solve the problem.

I am afraid the stability of this engine is partly a result of the engine being extremely hard to use in a free style. I find it not too robust yet when instead of letting the engine decide, you actually try to use it for something technically demanding.


Last edited by cantele on 20.07.2008, 10:10, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 10:04 
Offline

Joined: 03.07.2008, 01:23
Posts: 50
Could I actually change the texture bound to the material on the fly? My current solution of binding first to a dummy texture and being incapable of doing anything but updates to it is not really satisfying. Or is this one of those issues needing new utility functions and/or patches?


Top
 Profile  
Reply with quote  
PostPosted: 20.07.2008, 11:28 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I've written a patch for that (as well as for changing other resource parameters on the fly) yesterday. But I wanted to talk with Nicolas first before uploading it. Unfortunately he won't have access to the internet until this evening, so I have to take a raincheck on that.


Top
 Profile  
Reply with quote  
PostPosted: 21.07.2008, 22:25 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Volker has posted the patch to update material resources after loading.

cantele wrote:
What's even more weird: I cannot create that texture later on - it is "in use" or "exists" (shows in the log), even though it was never found in the first place. It can be found as a texture resource with the correct name. Unloading it returns true, no matter how many times I unload it (meaning it's unloaded?). However it cannot be found by querying unloaded resources after unloading (does this mean it's unqueriable by default, and why?).


The material loaded by the pipeline creates a new texture resource if it is not yet existing. Unloading is not the same as removing but I think that's clear. I'm not sure why it does not show up when using queryUnloadedResource. Could you debug into the function to see what's going on?


Top
 Profile  
Reply with quote  
PostPosted: 22.07.2008, 16:24 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
marciano wrote:
cantele wrote:
What's even more weird: I cannot create that texture later on - it is "in use" or "exists" (shows in the log), even though it was never found in the first place. It can be found as a texture resource with the correct name. Unloading it returns true, no matter how many times I unload it (meaning it's unloaded?). However it cannot be found by querying unloaded resources after unloading (does this mean it's unqueriable by default, and why?).

The material loaded by the pipeline creates a new texture resource if it is not yet existing. Unloading is not the same as removing but I think that's clear. I'm not sure why it does not show up when using queryUnloadedResource. Could you debug into the function to see what's going on?
I just ran into this problem as well, while generating textures. It turns out that the constructor for Texture2DResource erroneously sets _loaded = true (egTextures.cpp, line 172, when this should be set instead when the texture data is loaded. I have fixed this so that the constructor only sets _loaded = true if the texture is renderable - you can find the fix in SVN.

_________________
Tristam MacDonald - [swiftcoding]


Top
 Profile  
Reply with quote  
PostPosted: 22.07.2008, 22:28 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
@swift: Great, thanks for fixing that!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group