Previous journal: | Next journal: |
---|---|
0124-2023-08-16.md | 0126-2023-08-19.md |
As of https://github.com/algofoogle/raybox-zero/commit/9073f822ae4f36340257ad17ff743278d3b3e293, tracing now produces results that seem right, rendering as expected in raybox-zero. This is a screenshot of the Verilator-based simulation rendering a given view:
It's made of the following additions today:
- Hard-coded 16x16 map_rom implemented; just uses bitwise logic to create a map.
- wall_tracer reads map_rom, and is now finished and works. It was nearly there anyway.
- map_overlay reads from map_rom, but it's a hack: 2nd instance of the same thing, to avoid contention during tracing.
- pov (view vectors) are incrementing player position to demonstrate motion.
- For now, given we haven't got texture mapping, I've got a simple reciprocal height scaler placed in the main rbzero module. Note that this means the tracer is outputting the visual wall distance (as Q7.9) for now, instead of direct wall height, becauses that will ultimately be better later for texture mapping.
- Try dark blue background.
- Get it going in TT04.
- Try on FPGA.
- We can visualise when a line trace completes by making it output a signal that places a dot directly on the point of the line where it is currently rendering to the screen.
- Don't try much optimisation until we've tried a TT04 fit.
- Improve README.
- For demo purposes, have a version that can render a view and allow basic player motion control from input pins, without having to depend on vectors via SPI.
- Check how many actual iterations it takes (and hence line time) to complete a trace, and if there is a HUGE amount of free time then we can delay line trace FSM start until after the map overlay region is exited.
- When doing optimisation, work on any shortcuts that can be made with the FSM, but also adding in the extra reciprocal (and maybe multiply) steps.
- Much later, when we know TT04 fit is good and optimisations are done, then try texture mapping and (say) reading map data from external memory...?
- SPI interface to set:
- Vectors, with option to either load for the next frame only, or load directly for next line (which might also require setting rayAddend directly?)
- Colours, esp. background halves.
- Map/debug overlay visibility.
- "Mode"? e.g. external control or SPI direct only. Or enable debug output signals, dither, etc?
- Texture mapping.
- External memory access: map and/or textures?
- 1 sprite? Might not be too bad.
Some interesting things to check out: