Dead Hackers Society
Other BBSes »
 
 

68k Inside

Sommarhack 2024

Silly Venture 2024 SE
Demoscene  Coding  CT60  Buy/sell

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]

Topic Posted by  Date 
Texture U/V misunderstanding Orion_ Jan,24.2015-17:41
  Re: Texture U/V misunderstanding ggn Jan,24.2015-21:43
    Re: Texture U/V misunderstanding Orion_ Jan,25.2015-18:07
      Re: Texture U/V misunderstanding ggn Jan,25.2015-20:51
  Re: Texture U/V misunderstanding mikro Jan,26.2015-10:05
    Re: Texture U/V misunderstanding Orion_ Jan,26.2015-15:47
      Re: Texture U/V misunderstanding Orion_ Jan,26.2015-17:54
      Re: Texture U/V misunderstanding mikro Jan,27.2015-11:26


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

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.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson