floodfill add buffer qualifiers, use image sampler

This commit is contained in:
NULL511
2024-05-04 16:33:11 -04:00
parent 94ad32bd7f
commit 50f0aacc5d
10 changed files with 40 additions and 13 deletions

View File

@ -0,0 +1,7 @@
#ifdef RENDER_SHADOWCOMP
layout(rgba8) uniform restrict image3D imgLpv1;
layout(rgba8) uniform restrict image3D imgLpv2;
#else
layout(rgba8) uniform readonly image3D imgLpv1;
layout(rgba8) uniform readonly image3D imgLpv2;
#endif

View File

@ -1,6 +1,3 @@
layout(rgba8) uniform image3D imgLpv1;
layout(rgba8) uniform image3D imgLpv2;
// How far light propagates (block, sky)
const vec2 LpvBlockSkyRange = vec2(15.0, 24.0);

View File

@ -7,8 +7,8 @@ const float LpvBlockBrightness = 2.0;
vec4 SampleLpvNearest(const in ivec3 lpvPos) {
vec4 lpvSample = (frameCounter % 2) == 0
? imageLoad(imgLpv1, lpvPos)
: imageLoad(imgLpv2, lpvPos);
? texelFetch(texLpv1, lpvPos, 0)
: texelFetch(texLpv2, lpvPos, 0);
lpvSample.b = pow(lpvSample.b, LpvBlockPower) * LpvBlockSkyRange.x;
lpvSample.rgb = HsvToRgb(lpvSample.rgb);

View File

@ -1,4 +1,8 @@
layout(r16ui) uniform uimage3D imgVoxelMask;
#ifdef RENDER_SHADOW
layout(r16ui) uniform uimage3D imgVoxelMask;
#else
layout(r16ui) uniform readonly uimage3D imgVoxelMask;
#endif
const uint VoxelSize = uint(exp2(LPV_SIZE));
const uvec3 VoxelSize3 = uvec3(VoxelSize);