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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user