|
@@ -147,6 +147,7 @@ void ChunkIntersection()
|
|
|
switch (hitSide)
|
|
switch (hitSide)
|
|
|
{
|
|
{
|
|
|
case 0: // front | NORTH
|
|
case 0: // front | NORTH
|
|
|
|
|
+ intersectionAttributes.normal = float3(0, -1, 0);
|
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), 1 - (currentPos.z - floor(currentPos.z)));
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), 1 - (currentPos.z - floor(currentPos.z)));
|
|
|
topLeftDayLight = getLight(lightOffset + 0);
|
|
topLeftDayLight = getLight(lightOffset + 0);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 3);
|
|
topLeftDynamicLight = getLight(lightOffset + 3);
|
|
@@ -158,6 +159,7 @@ void ChunkIntersection()
|
|
|
bottomRightDynamicLight = getLight(lightOffset + 45);
|
|
bottomRightDynamicLight = getLight(lightOffset + 45);
|
|
|
break;
|
|
break;
|
|
|
case 1: // back | SOUTH
|
|
case 1: // back | SOUTH
|
|
|
|
|
+ intersectionAttributes.normal = float3(0, 1, 0);
|
|
|
intersectionAttributes.texCoord = float2(currentPos.x - floor(currentPos.x), 1 - (currentPos.z - floor(currentPos.z)));
|
|
intersectionAttributes.texCoord = float2(currentPos.x - floor(currentPos.x), 1 - (currentPos.z - floor(currentPos.z)));
|
|
|
topLeftDayLight = getLight(lightOffset + 12);
|
|
topLeftDayLight = getLight(lightOffset + 12);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 15);
|
|
topLeftDynamicLight = getLight(lightOffset + 15);
|
|
@@ -169,6 +171,7 @@ void ChunkIntersection()
|
|
|
bottomRightDynamicLight = getLight(lightOffset + 33);
|
|
bottomRightDynamicLight = getLight(lightOffset + 33);
|
|
|
break;
|
|
break;
|
|
|
case 2: // left | EAST
|
|
case 2: // left | EAST
|
|
|
|
|
+ intersectionAttributes.normal = float3(1, 0, 0);
|
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.y - floor(currentPos.y)), 1 - (currentPos.z - floor(currentPos.z)));
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.y - floor(currentPos.y)), 1 - (currentPos.z - floor(currentPos.z)));
|
|
|
topLeftDayLight = getLight(lightOffset + 6);
|
|
topLeftDayLight = getLight(lightOffset + 6);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 9);
|
|
topLeftDynamicLight = getLight(lightOffset + 9);
|
|
@@ -180,6 +183,7 @@ void ChunkIntersection()
|
|
|
bottomRightDynamicLight = getLight(lightOffset + 27);
|
|
bottomRightDynamicLight = getLight(lightOffset + 27);
|
|
|
break;
|
|
break;
|
|
|
case 3: // right | WEST
|
|
case 3: // right | WEST
|
|
|
|
|
+ intersectionAttributes.normal = float3(-1, 0, 0);
|
|
|
intersectionAttributes.texCoord = float2(currentPos.y - floor(currentPos.y), 1 - (currentPos.z - floor(currentPos.z)));
|
|
intersectionAttributes.texCoord = float2(currentPos.y - floor(currentPos.y), 1 - (currentPos.z - floor(currentPos.z)));
|
|
|
topLeftDayLight = getLight(lightOffset + 18);
|
|
topLeftDayLight = getLight(lightOffset + 18);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 21);
|
|
topLeftDynamicLight = getLight(lightOffset + 21);
|
|
@@ -191,6 +195,7 @@ void ChunkIntersection()
|
|
|
bottomRightDynamicLight = getLight(lightOffset + 39);
|
|
bottomRightDynamicLight = getLight(lightOffset + 39);
|
|
|
break;
|
|
break;
|
|
|
case 4: // top
|
|
case 4: // top
|
|
|
|
|
+ intersectionAttributes.normal = float3(0, 0, 1);
|
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), 1 - (currentPos.y - floor(currentPos.y)));
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), 1 - (currentPos.y - floor(currentPos.y)));
|
|
|
topLeftDayLight = getLight(lightOffset + 6);
|
|
topLeftDayLight = getLight(lightOffset + 6);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 9);
|
|
topLeftDynamicLight = getLight(lightOffset + 9);
|
|
@@ -202,6 +207,7 @@ void ChunkIntersection()
|
|
|
bottomRightDynamicLight = getLight(lightOffset + 21);
|
|
bottomRightDynamicLight = getLight(lightOffset + 21);
|
|
|
break;
|
|
break;
|
|
|
case 5: // bottom
|
|
case 5: // bottom
|
|
|
|
|
+ intersectionAttributes.normal = float3(0, 0, -1);
|
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), currentPos.y - floor(currentPos.y));
|
|
intersectionAttributes.texCoord = float2(1 - (currentPos.x - floor(currentPos.x)), currentPos.y - floor(currentPos.y));
|
|
|
topLeftDayLight = getLight(lightOffset + 24);
|
|
topLeftDayLight = getLight(lightOffset + 24);
|
|
|
topLeftDynamicLight = getLight(lightOffset + 27);
|
|
topLeftDynamicLight = getLight(lightOffset + 27);
|