mirror of
https://github.com/Merlin1809/Eclipse-Shader.git
synced 2026-10-12 02:08:18 +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));
|
|
}
|