Skip to content

Commit

Permalink
factor in fog distance correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
AnOpenSauceDev committed Dec 2, 2024
1 parent 032ead8 commit fe212af
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public void particleFogOcclusion(Particle instance, VertexConsumer vertexConsume
double dx = pointA.x - pointB.x;
double dz = pointA.z - pointB.z;
double distance = (dx * dx + dz * dz);
double shaderFogDistance = RenderSystem.getShaderFogEnd();

var renderDistance = Minecraft.getInstance().gameRenderer.getRenderDistance();
var color = RenderSystem.getShaderFogColor();
Expand All @@ -46,9 +47,8 @@ public void particleFogOcclusion(Particle instance, VertexConsumer vertexConsume
return false;
}

var fogDist = Math.min(renderDistance,distance);
var fogDist = Math.min(renderDistance,shaderFogDistance);

return distance < fogDist * fogDist;
}

}

0 comments on commit fe212af

Please sign in to comment.