How to Access Environment Texture

How do I access the environment texture that is reflected on PBR materials? For example, in this playground the boombox is reflecting the environmentSpecular.env texture. Is there a way other than:

scene.getTextureByUniqueID()

to access this texture?

The eventual goal is to use the texture’s rotateY parameter to change where the reflections are on a variety of meshes. In my test scene, the Unique ID of each texture changes with each reload, so I don’t think getTextureByUniqueID() will work for me.

Thanks in advanced!

you have it on scene.environmentTexture

1 Like

Hi gang. Wingnut was goofing around with that playground when DK answered/solved. https://www.babylonjs-playground.com/#QCU8DJ#37 Worth seeing? I think so. Interesting effect. :slight_smile:

Cool idea. hmm. There is only one scene.environmentTexture for entire scene, so… hmm. Perhaps better to rotate model/camera, and NOT rotate environment?

Unless… maybe, you are using a telescope/observatory and need to deal with Earth rotation and a Foucault pendulum. :o

Nah, nobody does Earth rotation tracking with BabylonJS, do they? Stellar time-lapse photography simulation?

Why am I still talking? DK solved the thread… move-on, Mr. Wingnut. :slight_smile:

1 Like