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.


sábado, 22 de enero de 2022

Tomb Raider (1)

 Yesterday (21-01-2022) I did a quick port of OpenLara to the Atari Jaguar. I'm just using the 68000, the other processors DSP, GPU, and blitter are stopped, of course, I'm using the OP or you won't see anything. 

You can see a small video here. Yes is running at 1FPS or maybe less.

I'm sure that the GPU is fast enough to do all 3D transformations for this game and most first-generation PS1/Saturn games but there are some problems.

  • The 68000 is too slow, is ok for a Genesis/Megadrive game, but it's too slow to make a modern shoot'em up (have a look at Sega Saturn games) with dozens of sprites, for a 3D game... forget it.
  • The more you use the Jaguar's hardware the fewer bus cycles are left for the 68000.
  • The Jaguar has only 2MB of RAM, the code takes 285Kb, and you have to store all textures, sounds, and 3D models. Just have a look at the filesize, almost none of them fit in RAM.