mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-20 16:07:22 +08:00
13 lines
383 B
GLSL
13 lines
383 B
GLSL
uint GetVoxelBlock(const in ivec3 voxelPos) {
|
|
// TODO: exit early if outside bounds
|
|
return imageLoad(imgVoxelMask, voxelPos).r;
|
|
}
|
|
|
|
uint GetVoxelBlock(const in vec3 playerPos) {
|
|
vec3 cameraOffset = fract(cameraPosition);
|
|
ivec3 voxelPos = ivec3(floor(playerPos + cameraOffset + VoxelSize/2u));
|
|
|
|
// TODO: exit early if outside bounds
|
|
return imageLoad(imgVoxelMask, voxelPos).r;
|
|
}
|