Art Vandelay Posted January 29, 2018 Share Posted January 29, 2018 Hi all, I have a 3d room I created that changes once in a while. I would like to create an HDR environment map of the room automatically so that PBR materials reflect the actual room. It doesn't need to be in real time, I can update it every couple minutes for example. Is there any way to do this? Thanks! Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted January 29, 2018 Share Posted January 29, 2018 Hi Art Vandelay! You can of course update the property reflectionTexture of the materials you need to update (skybox's material included). This will work if your 3D room changes from a static state to an other static state and you have the textureMap. https://playground.babylonjs.com/#J3S4Y6 However, if your room is fully dynamic, you might find a way to do what you need using reflectionProbe as reflectionTexture. Because probes are heavy, I suggest you to use probe.refreshRate = BABYLON.RenderTargetTexture.REFRESHRATE_RENDER_ONCE; to avoid computing the reflection each frame. Then you could use probe.resetRefreshCounter to update your reflectionTexture when you need it. Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted January 29, 2018 Author Share Posted January 29, 2018 Just what I needed, many thanks reflectionProbe did the trick! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.