5
$\begingroup$

I need to do planar reflection mapping in OpenGL. By using a virtual camera (with a reversed camera ray) at the back of reflective plane (a mirror), I rendered the scene to texture, which is then texture mapped to the mirror. The uvs of four corners of the mirror is specified then (using the result of gluProjection). The problem is by default, the uv coordinates are perspective-correctly interpolated, which is not desirable in this case. Is there any way to disable the perspective correction (without using GLSL)?

$\endgroup$
8
  • $\begingroup$ The only thing I can think of is doing the perspective projection on the CPU, and using an ortho matrix... Does that work? $\endgroup$ Commented Feb 3, 2016 at 14:07
  • 5
    $\begingroup$ why not use glsl? You are going to need to learn to program a shader eventually why not now. $\endgroup$ Commented Feb 3, 2016 at 14:54
  • 5
    $\begingroup$ It should be possible to do this using projective texture mapping, which can be done in fixed-function by providing 4-dimensional texcoords. I'd have to sit down and do the math to work out the details though. $\endgroup$ Commented Feb 3, 2016 at 16:48
  • 1
    $\begingroup$ Nathan's right - you can undo perspective projection with a 4th coordinate (I too would have to work out the math); look into texture coordinate generation. I have vague memories that on (very) old hardware precision can crop up as an issue (I think implementing stipple this way was error prone - I never had to do it personally) - so if old hardware is why you're not able to use shaders, you may bump into some oddities at the pixel level. But it is a better approach, especially if you have alot of geometry or if you are using vertex buffers. $\endgroup$ Commented Feb 7, 2016 at 12:54
  • 1
    $\begingroup$ If you figured it out yourself, you might want to answer you own question then. $\endgroup$ Commented Oct 1, 2017 at 16:16

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.