Hi all.
I’m wondering how to properly dispose of lighting effects from a DDS skybox. It seems that skybox.dispose() will get rid of the box itself, but that lighting remains on any object that was loaded in.
Is there a trick to remove lighting from loaded objects?
thx.
Screenshot shows scene after disposal of DDS skybox.
Sphere that was created has lighting removed at center.
Other objects loaded in from GLB still have DDS lighting effects.
The reason for the black sphere in the middle seems to be that it has no material.
I added a PBRMaterial and it went full mirror mode
The reason is that you dispose only the skybox. This means the background from your scene is gone.
When you created the skybox you implicitly set the environmentTexture of the scene which is used for PBR lighting.
When you set the scene.environmentTexture to null the whole lighting is gone
Have been playing around with this - but it seems that setting scene.environmentTexture=null doesn’t completely deactivate the environment texture. A couple of textures still exist from the skybox (which change the colortone/lighting of the scene):
I tried a loop to remove all textures as part of a “destroyAll()” sequence, but nothing shows up after that. Any ideas for how to completely remove the skybox/textures?
Hm, hold on. I just loaded that PG again and now it’s working…!? Those textures are still there… but they seem to be having no impact now. Hm, not sure what’s going on.