smarter sampling on the floor...
when it samples the floor tex, it raycasts the texelspace grid to see how many screen-pixels it'll step along the scanline before hitting the next texel, and it can reuse the latest sample until then - fewer samples, sharper result!
it also does some smooth LOD, where it starts using a bigger and bigger "screen-pixel steps per sample" ratio as pixels get farther away
(before/after)
conveniently, i already wrote a playdate serializer for C, for that previous music-maker app
here's the code for serializing/deserializing a track and its replay. serialization and deserialization use these same functions (the Serializer has a flag to tell it whether it's reading or writing) - so there's no need for annoying/error-prone "near duplicate" routines for input/output
it supports ascii format (more legible) and binary format (smaller file)
added a way to save your replay from the daily challenge, as a way to "chess by mail" against your friends without having to author a map first
also a nice idea from @fsouchu: ghost cars become opaque when you're not touching them
added object-sorting to fix the "inside out" walls (check the right side of the screen in the previous clip to see that) - i haven't mixed the cars into that sorting pool yet, but i'll do that soon
gonna need to figure out some static-object culling to skip faraway stuff quickly...there are a lot of small wall-meshes in a full track
making a weird bonus-renderer for little prize-scenes, for players who do well enough in the campaign mode (pre-render a gbuffer offline, do user-controlled lighting/fog/sky on the device)
i'm keeping the actual scenes a secret since they're player rewards, so here's a temp tester-scene instead
a neat thing here is that the actual triangles never make it to the device, so polycount doesn't affect performance or the game's download size. in this scene, each monkey-head is 60k+ triangles!
added a replay-viewer mode with some procgen camera angles:
- chase cam: random world-offset from the car, as if a drone is following it
- rigged cam: random local-offset from the car, as if a camera is attached to it
- tripod cam: random upcoming wall position, as if a bystander is watching the car go past
fun fact, the greyscale export operates by sicko-mode rules: it renders each frame of gameplay 32 times with different dither-pattern offsets, then blends them all together to get a final greyscale image (this is also where that scanline effect comes from)
since the game is optimized to run on a small handheld, when it's running on a PC it can do this in realtime - so the software renderer is hitting like 1000 fps (while also writing 30 files to disk per second)