|
Atari coding BBS
Re: Texture U/V misunderstanding |
Posted by: ggn
|
Jan,25.2015-20:51
|
Trust me mate, I haven't coded 3D ever - not even a rotozoomer :).
What I assume is being done here is that the longword holds 2 8.8 fractional numbers. So, high word has one number and low word the other. Furthermore each word is split in the integer part (high byte) and fraction (low byte). With 16.16 numbers you'd need 2 longwords to keep them and double the instructions to update them (2 add.ls). Then you'd need to combine them into a texture offset (again I assume here that the texture is 256x256 with each pixel taking a full byte). So I guess what those lsr/rol pair does is to combine x and y coords into the texture (which again if I'm not mistaken we call them U and V to avoid confusion) and then you can access the texture value directly using a move.b. Reading from the source buffer with a skew, writing into the output buffer sequentially.
Hope that helps a bit? (if any of this is right ;))
|
[All messages in this thread] [Start new thread]
What's the anti-troll code? That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
|