Horde3D
http://www.horde3d.org/forums/

Problem with: Static pipeline, dynamic content
http://www.horde3d.org/forums/viewtopic.php?f=2&t=428
Page 1 of 1

Author:  cantele [ 17.07.2008, 15:09 ]
Post subject:  Problem with: Static pipeline, dynamic content

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?

Author:  cantele [ 17.07.2008, 16:06 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

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.

Author:  cantele [ 20.07.2008, 10:04 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

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?

Author:  Volker [ 20.07.2008, 11:28 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

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.

Author:  marciano [ 21.07.2008, 22:25 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

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?

Author:  swiftcoder [ 22.07.2008, 16:24 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

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.

Author:  marciano [ 22.07.2008, 22:28 ]
Post subject:  Re: Problem with: Static pipeline, dynamic content

@swift: Great, thanks for fixing that!

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/