Posted 06 January 2012 - 12:11 PM
Posted 06 January 2012 - 02:33 PM
Posted 06 January 2012 - 04:24 PM
They're a bit old, but the technique itself hasn't changed at all. In the future, it would be better to ask specific questions about the topic rather than asking people to explain it generically for you. There are better resources immediately available on the web than what we could sum up for you in a few paragraphs. Plus it would be a waste of our time.
Since you asked though, I'll give you a super quick explanation. When you project triangles from the scene onto the screen, you are losing information about depth (i.e. flattening the triangles). If you try and linearly interpolate the pixels in screen space--that is, stepping one pixel at a time, line by line, through the triangle--you don't have the distance information to properly compute what the texture coordinates should be. For instance, moving one pixel to the right on a triangle that is nearly edge-on to the screen (one edge is close to the viewer while the other is far away from the viewer) will need a different result than if the triangle is parallel to the screen. Perspective correct texture mapping fixes this problem by using u/z and v/z instead of just u and v, as well as the interpolated 1/z coordinate for the triangle. The reciprocal is used because it is in fact linear in screen space.
To learn more about it, read Hecker's article or find another article somewhere else that explains in the way that you understand the most.
Posted 06 January 2012 - 06:09 PM
Actually, it should help. The first link is Wikipedia, which gives you a quick, top-level explanation. The next couple are FlipCode, which is a good site for game code info, and some StackOverflow Q&As which is a great resource to use for any code. There's an MSDN article from Microsoft, the Chris Hecker article zbethel mentions, etc, etc, etc. A basic concept like perspective correct texture mapping is not something that will change over time, so these links have not nor will they somehow become "invalid".
So, yeah, honestly, and with no mean intent, there's a lot more there than you'd get in a forum post.
No taking (or giving?) of piss intended...
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users