hcmetal Posted September 19, 2018 Share Posted September 19, 2018 Hello everyone, Trying to change scene environment textures smoothly with some kind of 'fade-in-out' effect rather than a hard toggle. Please consider this PG: https://playground.babylonjs.com/#26LZLL When the buttons are clicked, the environment texture is toggled between two .env maps. Is it possible to make the toggle more smooth, so it is more like a 'transition' than a 'snap'? Even a simple overlay of the two maps is ok. Hope someone can point me to the right direction. Thanks a lot! PS: Those handy test spheres in the PG are kindly provided by @PatrickRyan Quote Link to comment Share on other sites More sharing options...
Sebavan Posted September 19, 2018 Share Posted September 19, 2018 Hello, this is not supported as only one environment texture is available. You could probably do it but it might be expensive as you need to create on each frame a new environment texture in a renderTarget by mixing the two first ones. This implies to render each faces * the number of mipmaps + a combination of the polynomials. hcmetal 1 Quote Link to comment Share on other sites More sharing options...
hcmetal Posted September 20, 2018 Author Share Posted September 20, 2018 @Sebavan, got it, thanks! I might try something crazy and totally destroy the framerate. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted September 20, 2018 Share Posted September 20, 2018 You can maybe try a black video-like fade in/out: envTex01.level = 1 short timing fadeOut from level = 1 to level = 0 (scene is now black) short timing fadeIn envTex02.level from level = 0 to level + 1 hcmetal 1 Quote Link to comment Share on other sites More sharing options...
hcmetal Posted September 20, 2018 Author Share Posted September 20, 2018 @V!nc3r, thanks for sharing your idea. I will give it a try. Cheers! 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.