Horde3D

Next-Generation Graphics Engine
It is currently 22.11.2024, 06:37

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 22.01.2013, 04:09 
Offline

Joined: 19.01.2012, 21:01
Posts: 55
I'm trying to clear out everything before loading the next level in my game, and I'm running into a thrown fault on h3dRender after I call h3dClear.

When I level loads, I call h3dClear, then reload my pipeline, and readd a camera, then set my viewport and resize my pipeline buffer.

It's literally the same code I use when the engine first starts up, except I'm getting a fault after I call the clear.

In my testing, I've found a few interesting things that I hope one of you guys can clear up for me.

First, instead of doing h3dClear, I tried manually removing all loaded nodes, and all resources. This works fine, but after checking the loaded resources, I'm seeing that calling h3dRemoveResource doesn't seem to actually remove the resources. They still show up as loaded. I'm guessing they'll get cleaned up eventually when the reference count drops to 0? No idea what's still holding the references though.

So after that I decided to look at the loaded resources right after my initial load and compare it to after I do my clear and reload my camera and pipeline.

Initial Load: [$Tex2D $TexCube $Tex3D pipelines/hdr.pipeline.xml pipelines/globalSettings.material.xml pipelines/postHDR.material.xml]

After clear and reload: [pipelines/hdr.pipeline.xml pipelines/globalSettings.material.xml pipelines/postHDR.material.xml textures/ambientMap.dds shaders/postHDR.shader shaders/utilityLib/fragPostProcess.glsl]

So, what I'm seeing is missing is the $Tex2D, $TexCube, and $Tex3D resources. What are these, and how do I reload them, and if I can't reload them, why does h3dClear, clear them at all?

I haven't found any reference to any of these in the forums yet. So I'm curious how other people do their level changes.


Top
 Profile  
Reply with quote  
PostPosted: 22.01.2013, 17:03 
Offline

Joined: 23.07.2009, 21:03
Posts: 51
Location: Germany
tshannon wrote:
In my testing, I've found a few interesting things that I hope one of you guys can clear up for me.

First, instead of doing h3dClear, I tried manually removing all loaded nodes, and all resources. This works fine, but after checking the loaded resources, I'm seeing that calling h3dRemoveResource doesn't seem to actually remove the resources. They still show up as loaded. I'm guessing they'll get cleaned up eventually when the reference count drops to 0? No idea what's still holding the references though.

So after that I decided to look at the loaded resources right after my initial load and compare it to after I do my clear and reload my camera and pipeline.

Initial Load: [$Tex2D $TexCube $Tex3D pipelines/hdr.pipeline.xml pipelines/globalSettings.material.xml pipelines/postHDR.material.xml]

After clear and reload: [pipelines/hdr.pipeline.xml pipelines/globalSettings.material.xml pipelines/postHDR.material.xml textures/ambientMap.dds shaders/postHDR.shader shaders/utilityLib/fragPostProcess.glsl]

So, what I'm seeing is missing is the $Tex2D, $TexCube, and $Tex3D resources. What are these, and how do I reload them, and if I can't reload them, why does h3dClear, clear them at all?

I haven't found any reference to any of these in the forums yet. So I'm curious how other people do their level changes.


Hi.
From the manual (-Advanced Topics -Pipeline Specification):
Texture defines a default texture that is used if no texture map is specified in a material; the initial value for sampler2D is $Tex2D (white default texture) and $TexCube (default cube map with black faces) for samplerCube

They are created in egModules.cpp. I guess it would make sense for h3dClear() to keep the default resources alive...

Regarding h3dRemoveResource():
Do you call h3dReleaseUnusedResources() afterwards, as is explained in the function's documentation?


In the RecastNavigationSample I add my camera node and other resources (pipelines/font material) on startup and never remove them. New scenes are added by adding a H3DResTypes::SceneGraph resource to the root node, which is the only node and resource I have to remove to get rid of the entire scene. The camera, its pipleines, etc. are never removed.
So far ( :? ) I haven't encountered any errors.


Top
 Profile  
Reply with quote  
PostPosted: 22.01.2013, 21:15 
Offline

Joined: 19.01.2012, 21:01
Posts: 55
Thanks for the info. That pretty much explains everything.


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: Bing [Bot] 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:  
Powered by phpBB® Forum Software © phpBB Group