floodfill voxel mask

This commit is contained in:
NULL511
2024-05-01 13:40:52 -04:00
parent 343a68c816
commit c4b51fcf9a
5 changed files with 79 additions and 12 deletions

View File

@ -0,0 +1,11 @@
const uint LpvSize = uint(exp2(LPV_SIZE));
layout(r16ui) uniform uimage3D imgVoxelMask;
// #if defined RENDER_SHADOWCOMP || defined RENDER_GBUFFER
// layout(r16ui) uniform uimage2D imgVoxelMask;
// #elif defined RENDER_BEGIN || defined RENDER_GEOMETRY || defined RENDER_VERTEX
// layout(r16ui) uniform writeonly uimage2D imgVoxelMask;
// #else
// layout(r16ui) uniform readonly uimage2D imgVoxelMask;
// #endif

View File

@ -0,0 +1,5 @@
void SetVoxelBlock(const in vec3 playerPos, const in uint blockId) {
vec3 cameraOffset = fract(cameraPosition);
ivec3 voxelPos = ivec3(floor(playerPos + cameraOffset + LpvSize/2u));
imageStore(imgVoxelMask, voxelPos, uvec4(blockId));
}

View File

@ -669,6 +669,18 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631)
#define DH_KNOWN_ISSUES 0 // [0 1 2 3 4 5]
///////////////////////////////////////////
// ----- DISTANT HORIZONS SETTINGS ----- //
///////////////////////////////////////////
#define LPV_ENABLED
#define LPV_SIZE 7 // [6 7 8]
#if defined LPV_ENABLED && defined IRIS_FEATURE_CUSTOM_IMAGES
#define IS_LPV_ENABLED
#endif
////////////////////////////////
// ----- DEBUG SETTINGS ----- //
////////////////////////////////