Jump to content

Nested reflections


fsmorygo
 Share

Recommended Posts

@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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...