sábado, 19 de febrero de 2022

Tomb Raider (3)

I've spent some days looking at OpenLara source code to better understand how it works.

For now, it works like this, all is executed into the 68000. Although all boxes have the same size, they take different times of processing.



Now, I'm building a command list and using it to do all the transformations and rendering. Although it has to build this list for each frame it wouldn't impact the performance.


You may think that this solution is a waste of time, but now I have each frame "chewed" into some plain data for the GPU, as soon as the command list is built I can tell the GPU to execute it.

The advantage is that the 68000 doesn't need to wait for the GPU, it can process the next frame while the GPU is doing all 3D Transformations, and polygon drawing.

Running these steps in parallel means the frame rate will be as fast as the XForm + Render part, instead of Logic + XForm + Render.

I hope that all the 3D Transformations and rasterizer fit into GPU RAM, so no need to be assisted from the 68000 to do some code swapping.