Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

planar reflection won't stay put


Recommended Posts

Hey Josh how did you get the planar reflections to stop following the camera on the water? Seems like no matter what I do if I nod the cam "yes" the reflection wont' stay put. This is what I have. I'm stuck here:


vec2 coord = gl_FragCoord.xy/buffersize;

if (isbackbuffer) coord.y = 1-coord.y;

vec4 reflectcol = texture(texture10,coord);

fragData0 = reflectcol;

Link to post
Share on other sites

Try flipping signs until it starts working. That's what I usually do when I'm stuck. :D

Also remember, the reflection camera matrix is going to be the same as the render projection matrix, except the pitch is reversed. And the render camera's Y scale should be -1.

  • Like 1
  • Confused 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to post
Share on other sites

The reflection camera also needs to draw the opposite side of all faces, since flipping one component of the scale reverses the triangle winding order.

  • Like 1
  • Confused 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to post
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.

×
×
  • Create New...