fsmorygo Posted October 15, 2018 Share Posted October 15, 2018 I have created a scene with two mirrors reflection one each other. I want to control how much times is reflection calculated to see the reflection in reflection. Is this possible via ReflectionTexture? Or ReflextionProbe? http://playground.babylonjs.com/#GYPUMJ Quote Link to comment Share on other sites More sharing options...
fsmorygo Posted October 15, 2018 Author Share Posted October 15, 2018 I see that reflection probes seem to be working in this case. How can I set them up for a plane to become a mirror just like in the MirrorTexture? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2018 Share Posted October 15, 2018 For plane to use Reflection probes, you need to turn on local cubemaps: http://doc.babylonjs.com/how_to/reflect#using-local-cubemap-mode Quote Link to comment Share on other sites More sharing options...
fsmorygo Posted October 15, 2018 Author Share Posted October 15, 2018 @Deltakosh Now I see. It became much better however I still get the perspective distortion (which seems obvious because the cubemap is built by looking from one point). http://playground.babylonjs.com/#GYPUMJ#1 Is there a way to make the same using mirrors or maybe there is another hack? The usecase is being inside of a mirror box. Edit: I think I've found a solution. Please correct me if I'm wrong. I should emulate the reflection by placing a probe not on the plane but behind it depending on the position of the camera. So if a reflective plane is a 1x1 plane with center at (0,0,0) having normal (0,0,-1) and camera is at (x, y, z) then the reflection probe location should be set to (-x, y, -z) Edit 2: This does not seem to work. (http://playground.babylonjs.com/#GYPUMJ#2) Edit 3: Now it's getting somewhere: http://playground.babylonjs.com/#GYPUMJ#3 But the second reflection in wrong because it is captured considering the camera position and in the mirror the position. I will try using different mesh with layerMask for the reflections. Thx for tips Quote Link to comment Share on other sites More sharing options...
Guest Posted October 15, 2018 Share Posted October 15, 2018 look like you are on the right track Quote Link to comment Share on other sites More sharing options...
fsmorygo Posted October 19, 2018 Author Share Posted October 19, 2018 @Deltakosh by the way what is supposed to be rendered within a MirrorTexture in the MirrorTexture?. I see some artifacts (random scene meshes and scene's `clearColor`)and this looks like a bug. Or am I missing something? Quote Link to comment Share on other sites More sharing options...
Guest Posted October 19, 2018 Share Posted October 19, 2018 You will see the previous frame content off the reflected MirrorTexture 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.