Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: Tim O'Neil Newsgroups: scee.yaroze.programming.3d_graphics Subject: Re: Textures are skewed. Date: Wed, 11 Mar 1998 15:34:42 -0500 Organization: SCEA News Server Lines: 30 Message-ID: <3506F562.74495D54@chat.carleton.ca> References: <3504949A.95F1D356@cybec.com.au> NNTP-Posting-Host: ott-pm2-25.comnet.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.01 [en] (Win95; I) X-Priority: 3 (Normal) Toby Hutton wrote: > Anyway, I have some textured quads. The texture I'm using is a grid, > a > whole lot of squares. When I put this texture on the quad, it'll go > all > skewwy when viewed from an angle. > > .... > Help!?! > > Toby.... Actually this is caused by the playstation renderer not doing perspective correction for the texture mapping (aka Affine texture mapping). Basically, the texel values are calculated at one edge of the polygon and are correct for that depth, but the values are then interpolated to fill the rest of the visible area. The problem with this is that the texels that are at a different depth (which happens when the polygon is at an angle to the camera), are calculated improperly. They should be calculated based on their z-depth, but they are calculated from the z-depth that the edge was at. To do the exact calculation would require dividing u and v by z (either 2 divides or 1 divide and 2 multiplies depending on how you do it) which is a lot more computation per pixel. The only way to avoid this problem is to keep the space between the interpolated values and the corect values to a minimum, so the errors are kept to a minimum (keeping polygons small/subdivision, etc).