Fix shader compilation warning and work around weird shader miscompilation on my intel laptop.

This commit is contained in:
IntegratedQuantum 2023-10-07 18:06:12 +02:00
parent 546aad5090
commit 4a4af0964e
2 changed files with 2 additions and 2 deletions

View File

@ -154,7 +154,7 @@ void main() {
totalOffset += ivec3(equal(textureY[oldNormal], ivec3(-1))) + (vertexID & 1)*textureY[oldNormal];
totalOffset = ivec3(permutationMatrix*(vec3(equal(mirrorVector, vec3(1)))*totalOffset + vec3(equal(mirrorVector, vec3(-1)))*(1 - totalOffset)));
ivec3 lowerBound = voxelModels[modelIndex].minimum.xyz;
ivec3 size = voxelModels[modelIndex].maximum.xyz - lowerBound;
ivec3 size = voxelModels[modelIndex].maximum.xyz - voxelModels[modelIndex].minimum.xyz;
totalOffset = lowerBound + size*totalOffset;
position += totalOffset - 16*ivec3(normals[normal]);

View File

@ -95,7 +95,7 @@ float calculateFogDistance(float dist, float fogDensity) {
void applyFrontfaceFog(float fogDistance, vec3 fogColor) {
float fogFactor = exp(fogDistance);
fragColor.rgb = fragColor.rgb*fogFactor + fogColor*(1 - fogFactor);
fragColor.rgb = fogColor*(1 - fogFactor);
fragColor.a = fogFactor;
}