Fix small mistake that messed up texturing.

This commit is contained in:
IntegratedQuantum 2023-09-22 11:55:04 +02:00
parent 3d19feae42
commit 3c638017f9

View File

@ -69,7 +69,7 @@ const vec3[6] normals = vec3[6](
); );
int getVoxel(ivec3 voxelPos) { int getVoxel(ivec3 voxelPos) {
int voxelIndex = (voxelPos.x) | (voxelPos.y << 4) | (voxelPos.z << 8); int voxelIndex = (voxelPos.x << 8) | (voxelPos.y << 4) | (voxelPos.z);
int shift = 4*(voxelIndex & 7); int shift = 4*(voxelIndex & 7);
int arrayIndex = voxelIndex >> 3; int arrayIndex = voxelIndex >> 3;
return (int(voxelModels[modelIndex].bitPackedData[arrayIndex])>>shift & 15) - 6; return (int(voxelModels[modelIndex].bitPackedData[arrayIndex])>>shift & 15) - 6;