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 vertexID = gl_VertexID & 3;
|
||||||
int chunkID = gl_BaseInstance;
|
int chunkID = gl_BaseInstance;
|
||||||
int voxelSize = chunks[chunkID].voxelSize;
|
int voxelSize = chunks[chunkID].voxelSize;
|
||||||
vec3 modelPosition = vec3(chunks[chunkID].position.xyz - playerPositionInteger) - playerPositionFraction;
|
|
||||||
int encodedPositionAndLightIndex = faceData[faceID].encodedPositionAndLightIndex;
|
int encodedPositionAndLightIndex = faceData[faceID].encodedPositionAndLightIndex;
|
||||||
int textureAndQuad = faceData[faceID].textureAndQuad;
|
int textureAndQuad = faceData[faceID].textureAndQuad;
|
||||||
uint lightIndex = chunks[chunkID].lightStart + 4*(encodedPositionAndLightIndex >> 16);
|
uint lightIndex = chunks[chunkID].lightStart + 4*(encodedPositionAndLightIndex >> 16);
|
||||||
@ -100,7 +99,8 @@ void main() {
|
|||||||
|
|
||||||
position += quads[quadIndex].corners[vertexID];
|
position += quads[quadIndex].corners[vertexID];
|
||||||
position *= voxelSize;
|
position *= voxelSize;
|
||||||
position += modelPosition;
|
position += vec3(chunks[chunkID].position.xyz - playerPositionInteger);
|
||||||
|
position -= playerPositionFraction;
|
||||||
|
|
||||||
direction = position;
|
direction = position;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user