jueves, 27 de enero de 2022

Tomb Raider (2)

Let's have a quick look at how (more or less) Tomb Raider works.

These are the steps of the render loop.

  1. Get camera room
  2. Set clipping area to the viewport
  3. For each room portal do:
    1. Project portal to screen
    2. Clip portal vertices to the current clipping area
    3. It's visible?
      1. Mark portal destination (another room) as visible
      2. Set clipping area to portal's bounding box
      3. go to 3 with that room.
  4. Render Lara
  5. For each visible room
    1. Render room's room
    2. Render room's sprites
    3. Render room's meshes
  6. Flush
All Render calls do the 3D transformations and include non culled polygons to a list, the actual rendering (pixels drawing) is done in the flush pass.

The next step will be to measure how much time takes each part (calculate visibility, render and flush), let's cross our fingers and hope that the first part (calculate visibility) is fast enough on the 68000, take in mind that the ARM in 3DO or GameBoy Advance is a lot faster than the 68000, so you have more free time to do the rendering.


1 comentario: