mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 16:44:58 +01:00
Improve rain shader
This commit is contained in:
21
shaders/vk14/water_clear.comp
Normal file
21
shaders/vk14/water_clear.comp
Normal file
@@ -0,0 +1,21 @@
|
||||
#version 460 core
|
||||
#define STAGE_COMPUTE 1
|
||||
// the water on the windscreens (water_sim.glsl): the counts of the cells of the grids emptied before the drops are put in them
|
||||
// (water_grid.comp). a thread per cell, a row of groups per glass
|
||||
|
||||
// none of the pass set: everything the kernel reads is pushed with its dispatch (set COMPUTE_SET, water_sim.glsl), so it runs
|
||||
// before the passes of the frame set theirs up
|
||||
#define LAYOUT_UI 1
|
||||
#include "common.glsl"
|
||||
#include "water_sim.glsl"
|
||||
|
||||
layout(local_size_x = WATER_GROUP_SIZE) in;
|
||||
|
||||
void main()
|
||||
{
|
||||
uint slot = gl_WorkGroupID.y;
|
||||
uint cell = gl_GlobalInvocationID.x;
|
||||
if ((water_slots[slot].z < 0.5) || (cell >= uint(WATER_GRID * WATER_GRID)))
|
||||
return;
|
||||
water_cells[water_grid_base(slot) + cell] = 0u;
|
||||
}
|
||||
Reference in New Issue
Block a user