18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 02:42:46 +01:00

Rain windscreen: the cells of the drops and rivulets worked out once a frame

The glass with rain worked out, in every pixel, the hashes and the life cycles of the 9 drop cells around it, of the rivulet
cells of its 5 layers and of those the drops are swept by. A compute pass (rain_cells.comp) now does it once a frame for every
cell into a buffer (rain_cells.glsl: RAIN_CELLS_SSBO in the pass set of Vulkan 1.4, binding 18 in OpenGL 4.6); the glass only
reads it, and asks the wipers only for the drops the pixel lies on. The hashes are the same, so the drops and the rivulets
are where they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
Claude
2026-11-03 15:54:28 +01:00
parent 339d70a6e6
commit 394e252daf
19 changed files with 674 additions and 196 deletions
+2
View File
@@ -1135,6 +1135,8 @@ void vulkan14_renderer::render_scene()
auto &scene{ctx.scene};
// the water on the windscreens of the cab: a step of its simulation once a frame, before the passes which draw the glasses
scene.water.update(Timer::GetDeltaTime());
// the drops and the rivulets of the glasses with rain, for the time the block of the scene gets (scene_ubs.time)
scene.water.update_rain_cells(static_cast<float>(Timer::GetTime()), glm::saturate(Global.Overcast - 1.f));
if (scene.targets.size() < m_viewports.size())
{
scene.targets.resize(m_viewports.size());