18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 22:07:55 +01:00
Files
maszyna/rendering
Hirek ae2ce61e9a fix(vulkan): stickers on vehicles no longer vanish behind the body seen at an angle
With the depth prepass of the scene, the colour pass of the alpha tested
materials (default, normalmap, pbr, ...) doesn't write the depth the prepass
drew (keepdepth) and tested it without a bias. The prepass draws everything
a little farther (constant -1, slope -1), so a surface lying up to a pixel's
worth of the slope behind the front one passed as well, and the one drawn
last covered the other. Seen from the side a few metres away that is more
than a millimetre: the warning stickers 1 mm off the buffer beam of the EP07
(303e) vanished under the beam, drawn after them.

Those draws now test their depth with the bias of the prepass, nearer by two
units and 1/16 of the slope (the position is invariant in both programs).
The colour pass sets its bias in apply_draw_state() for the kept draws and
the decals together; the depth drawn inside the colour pass holds its own.

The OpenGL 4.6 renderer writes the depth in its colour pass and isn't
affected. No asset changes.
2026-11-30 20:09:18 +01:00
..