Bliss-Shader/shaders/lib/voxel_common.glsl

14 lines
350 B
Plaintext
Raw Normal View History

2024-05-01 16:32:25 -04:00
layout(r16ui) uniform uimage3D imgVoxelMask;
const uint VoxelSize = uint(exp2(LPV_SIZE));
const uvec3 VoxelSize3 = uvec3(VoxelSize);
2024-05-02 14:18:49 -04:00
const float voxelDistance = 64.0;
2024-05-01 16:32:25 -04:00
#define BLOCK_EMPTY 0
2024-05-02 12:43:30 -04:00
ivec3 GetVoxelIndex(const in vec3 playerPos) {
vec3 cameraOffset = fract(cameraPosition);
2024-05-02 14:18:49 -04:00
return ivec3(floor(playerPos + cameraOffset) + VoxelSize3/2u);
2024-05-02 12:43:30 -04:00
}