wipeout-rewrite icon indicating copy to clipboard operation
wipeout-rewrite copied to clipboard

Track image bleeds through ship engine area

Open tjrileywisc opened this issue 2 years ago • 3 comments

image

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.

tjrileywisc avatar Sep 01 '23 18:09 tjrileywisc

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...

phoboslab avatar Sep 01 '23 20:09 phoboslab

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

jnmartin84 avatar Apr 28 '25 13:04 jnmartin84

Image

jnmartin84 avatar Apr 28 '25 13:04 jnmartin84