Perspective correct texture mapping

5443120feaaf793d9234dbc7e2e72a23
0
Ryan_Marcus_French 101 Jan 06, 2012 at 12:11 android animation ai algorithm

Can someone give me an overall explanation on what this is?

4 Replies

Please log in or register to post a reply.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Jan 06, 2012 at 14:25

http://lmgtfy.com/?q=Perspective+correct+texture+mapping+

5443120feaaf793d9234dbc7e2e72a23
0
Ryan_Marcus_French 101 Jan 06, 2012 at 14:33

You really think that this helps , i need to know what it is now that are alot of sources that are invalid , please dont take the piss.

215de2bbbaea860d666b2a7d4c4fdf37
0
zbethel 101 Jan 06, 2012 at 16:24

Chris Hecker has some great articles on this topic: http://www.gamers.or…ker_texmap.html

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.

Cheers,
Zach.

8676d29610e6c98d6dd2d9c38528cd9c
0
alphadog 101 Jan 06, 2012 at 18:09

@Ryan Marcus French

You really think that this helps , i need to know what it is now that are alot of sources that are invalid , please dont take the piss.

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…