Fade-in and fade-out between VR scenes

Hi Dan,

Welcome to Babylon! Depending on exactly what effect you’re going for, there are a lot of things you can try, but something simple like the following might be enough to get you started.

https://playground.babylonjs.com/#QUM4H3

This is the default Playground with a little additional logic on lines 31 through 40. Essentially all that I do is set up a callback that will be run every frame, then use that to set the light intensity (and the clear color) to a value determined by whatever system is controlling the fade (in my case, just a simple cosine function pegged to the frame count). Depending on what kinds of assets you’re using, you might need to fade other things (environment lighting, etc.) but the same basic approach should work.

1 Like