<p>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)?</p>

CC BY-SA 3.0
2017-10-01T16:16:01.787Z
If you figured it out yourself, you might want to answer you own question then.
Christian Rau
CC BY-SA 3.0
2016-02-03T14:54:31.353Z
why not use glsl? You are going to need to learn to program a shader eventually why not now.
ratchet freak
CC BY-SA 3.0
2016-02-03T16:48:34.523Z
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.
Nathan Reed
CC BY-SA 3.0
2016-02-07T05:05:58.510Z
@DanielMGessel I think that's a good idea. I'll try.
DQLin
CC BY-SA 3.0
2016-02-07T05:06:37.673Z
@ratchetfreak Actually it's a project requirement...
DQLin
CC BY-SA 3.0
2016-02-09T08:48:56.447Z
@DanielMGessel I figured it out. Just use(sz,tz,0,z) and it works, where z is z-coordinate in eye space.
DQLin
<opengl>
How to disable Perspective Correction in Texture Coordinates Interpolation in OpenGL(without using shaders)?
DQLin
# How to disable Perspective Correction in Texture Coordinates Interpolation in OpenGL(without using shaders)?

(Asked by: username_0 on 2016-02-03)

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)?

**Tags:** opengl

> **Comments:**
> **username_2**: why not use glsl? You are going to need to learn to program a shader eventually why not now.  
> **username_3**: 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.  
> **username_0**: @DanielMGessel I think that's a good idea. I'll try.  
> **username_0**: @username_2 Actually it's a project requirement...  
> **username_0**: @DanielMGessel I figured it out. Just use(sz,tz,0,z) and it works, where z is z-coordinate in eye space.  
> **username_1**: If you figured it out yourself, you might want to answer you own question then.  

---

## 0 answers

