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 samplerCubeThey 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.