View Full Version : Legitimate use case for noperspective

Alfonse Reinheart
06-10-2011, 10:21 PM
I was doing some of the writeup for my texturing tutorials, and I was wondering something. Has anyone ever use "noperspective" interpolation for something?

I know what it does; I'm just wondering what the actual use cases are. What graphical effect needs to do window-space linear interpolation with a perspective projection?

06-11-2011, 06:57 AM
A single pass wireframe-over-shaded algorithm uses it. Essentially, each vertex of a triangle is assigned a barycentric coordinate {1,0,0}, {0,1,0} and {0,0,1} for an interpolated edge distance varying. It is defined as noperspective so that the resulting outlines stay the same width on each edge, regardless of orientation.

I originally came across this technique here:


06-13-2011, 04:04 PM
I use it for simple HUD shaders merely to indicate that screen-space quads don't need per-pixel divides.

(this is more relevant in the context of a software rasterizer...)