mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2025-06-20 07:57:55 +08:00
8 lines
281 B
GLSL
8 lines
281 B
GLSL
void SetVoxelBlock(const in vec3 playerPos, const in uint blockId) {
|
|
vec3 cameraOffset = fract(cameraPosition);
|
|
ivec3 voxelPos = ivec3(floor(playerPos + cameraOffset + VoxelSize/2u));
|
|
|
|
// TODO: exit early if outside bounds
|
|
imageStore(imgVoxelMask, voxelPos, uvec4(blockId));
|
|
}
|