mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 03:52:52 +01:00
2dd53bc97b
The glare was drawn whole or not at all, depending on whether any sample of the light point passed the depth test. The point is a few pixels wide, so where it sits at the edge of something in front of it (the hood of the lamp, a mast, a wire) the large glare switched on and off as the camera moved and the signal seemed to flash. The opengl renderer now counts the samples of the point which are seen and, drawing the point once more without the depth test and without colour, all of its samples. The gpu writes both counts into a small storage buffer (GLARE_SSBO_BINDING) and billboard.frag scales the glare by their ratio, so a partly hidden lamp gets a fainter glare instead of a flashing one. The conditional render still leaves out the glare of a point not seen at all. The vulkan renderer is unchanged.