Jump to content
  • Advertisement
  • entries
  • comments
  • views

Perspective Interpolation

Sign in to follow this  
Jason Z


Perspective Interpolation
I am trying to get my head around perspective correct interpolation. There is no issue understanding how it is supposed to be implemented, but the idea of it seems to be pretty strange. The idea is, even after you have projected your vertices into clip space that the vertex attributes need to be corrected for the perspective - even though the vertex positions themselves have been projected with a perspective projection.

After thinking about it for a while, the even though from the last sentence should be changed to because of! It really only makes sense that for a given vertex, if its position is 'perspectified' (not a real word but you know what I mean[grin]) then its attributes must be 'perspectified' as well.

When testing out the rasterizer, the screen shots in my previous posts were all generated with a perspective projection, but the four vertices were always co-planar to the viewing plane. This doesn't create any perspective distortion, and essentially negates the need for perspective interpolation. This can be seen here:

However, if the vertices from one side of the square are moved closer to the camera, a perspective distortion occurs. The position of the vertices are perspectively correct, but the attributes (texture coordinates in this case) are not correctly interpolated. This can be seen here:

I'll post some updated screens once the perspective interpolation is up and running. It's good to understand these issues, because if you never worked on a software renderer, then the hardware API will always hide this type of operation from you. So its a great learning experience - try it out, its worth it!
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!