Marzac / le3d

A straightforward and easy to use 3D software renderer for real-time retro graphics.
https://marzac.github.io/le3d/
MIT License
60 stars 6 forks source link

w representation and AMMX asm rasterizer #30

Closed Marzac closed 6 years ago

Marzac commented 6 years ago

Hi @m0ppers.

I committed a new version of the engine where the W coordinates (1 / z) are now normalized. Now the Ws range from -1.0 to 0.0 (near clipping plane to infinity) disregarding the near clipping plane absolute distance.

To benefit from the now possible gain of precision in fixed point calculations, I updated the integer rasterizer so that the Ws representation is now:

w = 1e30 / z

this representation used to be (to have some margins / shit hack):

w = 1e28 / z

So that it works as it should on the Amiga target, please update your shifts in your AMMX code. Thx, Fred

m0ppers commented 6 years ago

I am currently off (well I am away but working) for 2 weeks so no access to my amiga right now. Will do so once I am back so I can test it :)

Marzac commented 6 years ago

No problem. I wrote this down here so you don't have to 'investigate'. It can be quite laborious to guess what has changed here and I did not want to update the AMMX with no means to test the result.