Another option to your code above would be to render the sky shader to a render target and use the texture from that as the scenes environment, there’s a good example on how to do that in Mugens post here Using shader material as texture - #2 by Mugen87 which is pretty much what you’re doing already without having to traverse the scene to hide all other objects and then reinstate their visibility every frame, instead just using a render target to get the sky alone as a texture output…
1 Like