Hi,
I’m using ObjectLoader to load a JSON Scene that contains an envMap texture. My application loads and unloads content regularly, sometimes involving large textures and geometries, and I want to be able to track these clearly using WebGLRenderer.info.memory
.
Whenever I load a JSON scene containing envMaps, the totals never return to 0, even with my comprehensive efforts to dispose of every geometry and maps of every type.
I have two examples of JSON scene; this is what is left over in each case after disposing of the scene:
- The JSON scene with a single envMap results in 1 texture and 10 geometries being left over
- The JSON scene with two envMaps results in 1 texture and 11 geometries being left over
If I remove the environment maps in these scenes, there are 0 textures and 0 geometries left over.
I was looking at source code, and wondered if WebGLCubeMaps
and WebGLCubeUVMaps
might be the place where such resources are created.
Another forum post here explains that Scene backgrounds’ resources are created internally and aren’t an issue. I’m not sure if the process will be the same in my case, i.e. in the case of envMaps in parsed external scene files - can anyone clarify this?
The thing that I’m most concerned about is: if this is expected behaviour, how can I keep track of the number of textures and geometries in the provided renderer counts, in terms of what proportion of these counts belong to the ‘nothing to worry about’ totals used by the environment map system? As I mentioned above, depending on which part of my application I execute, I can have 1+10, or 1+11. The best I can do here is to monitor my texture and geometry usage by subtracting 1 and 11 respectively, but only once I know I’ve executed a part of my application that will result in the first appearance of these residual numbers.
I hope that I’m simply missing something or doing something wrong; any help would be appreciated.