delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/06/12:35:30

Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE30162E5D4@probe-2.acclaim-euro.net>
From: Shawn Hargreaves <ShawnH AT Probe DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: PTEX polygon mapping - how are u/v coordinates written?
Date: Mon, 6 Sep 1999 12:36:56 +0100
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.0.1460.8)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id HAA11343
Reply-To: djgpp AT delorie DOT com

Bengt-Åke Forslund writes:
> The embryonic engine takes the vertices, applies a camera matrix to them,
> clips them and perspective projects them. Then they are fed into the
> polygon3d_f function, with the PTEX mode parameter.
>
> However, the texture mapping just gives weird results. Does anyone have
any
> clue as to why this?

Does your code work ok if you use the ATEX (affine texture mapping) mode
instead of PTEX? If so, the problem is almost certainly that you don't
have valid z coordinates in your vertex structures (that info is required
for doing the perspective correction). If the ATEX mode is also going
wrong, you must either have the wrong u/v coordinates, or an invalid
texture bitmap. Double check what units you are storing these values in
(if you use the floating point code, the coordinates are in texture-space
pixels, but if you use the fixed point code, they are in 16.16 fractional
format), and make sure that your texture bitmap really is a power of two
in size, and in the same color depth as the screen. Another possibility
is that you could be using a mode-X screen resolution, because the 
polygon rendering code doesn't work at all in mode-X.


	Shawn Hargreaves.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019