Track image bleeds through ship engine area
This has probably been a bug since forever. It's easier to spot if you fly over the weapon collect points or the sides of the track.
The way to fix this is to draw the exhaust plume in a separate draw call from the rest of the ship. The exhaust plume (being transparent) shouldn't write to the depth buffer. Currently the whole ship is in a single object, which makes this difficult. We'd need to patch the object loading to somehow put the exhaust plume geometry in a separate object.
I'm actually thinking about rewriting the renderer to upload all geometry to the gpu on load time (as outlined in #61). The exhaust plume is the only instance in the game where vertex positions are updated. But we do have a bunch more instances where the vertex colors are changed each frame (most of them in scene.c + the weapon tiles on the track) – changing these to work on raw tris_t is quite involved.
I need to find a bunch of free time to dive into this...
I found a fix for this that doesn't involve making separate objects or having to mess with depth write.
Thought about what would be done on PSX to make this look right: Draw the flames after every other ship primitive; there isn't really depth, there's no z-buffer, they just have to be submitted last.
Took a wild guess that putting the PRM_SHIP_ENGINE primitives at the end of the object's primitive list would fix this, and it did.
See: https://github.com/phoboslab/wipeout-rewrite/pull/153