mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-04 03:37:59 -04:00
Fix pixel errors at chunk borders.
The floating point numbers were rounded differently depending on the chunk.
This commit is contained in:
parent
22488a28ae
commit
47adc1067d
@ -68,7 +68,6 @@ void main() {
|
||||
int vertexID = gl_VertexID & 3;
|
||||
int chunkID = gl_BaseInstance;
|
||||
int voxelSize = chunks[chunkID].voxelSize;
|
||||
vec3 modelPosition = vec3(chunks[chunkID].position.xyz - playerPositionInteger) - playerPositionFraction;
|
||||
int encodedPositionAndLightIndex = faceData[faceID].encodedPositionAndLightIndex;
|
||||
int textureAndQuad = faceData[faceID].textureAndQuad;
|
||||
uint lightIndex = chunks[chunkID].lightStart + 4*(encodedPositionAndLightIndex >> 16);
|
||||
@ -100,7 +99,8 @@ void main() {
|
||||
|
||||
position += quads[quadIndex].corners[vertexID];
|
||||
position *= voxelSize;
|
||||
position += modelPosition;
|
||||
position += vec3(chunks[chunkID].position.xyz - playerPositionInteger);
|
||||
position -= playerPositionFraction;
|
||||
|
||||
direction = position;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user