Revert "Use MC's projection matrix in SSAO instead of creating a new one"

This reverts commit 5735599569.
This commit is contained in:
James Seibel
2023-09-09 18:22:33 -05:00
parent e415d1cb72
commit 2d1729d325
2 changed files with 9 additions and 4 deletions
@@ -283,7 +283,7 @@ public class LodRenderer
if (Config.Client.Advanced.Graphics.Ssao.enabled.get())
{
profiler.popPush("LOD SSAO");
SSAORenderer.INSTANCE.render(minecraftGlState, baseProjectionMatrix, partialTicks);
SSAORenderer.INSTANCE.render(minecraftGlState, partialTicks);
}
@@ -179,7 +179,7 @@ public class SSAORenderer
// render //
//========//
public void render(GLState primaryState, Mat4f projection, float partialTicks)
public void render(GLState primaryState, float partialTicks)
{
GLState state = new GLState();
@@ -204,7 +204,12 @@ public class SSAORenderer
float near = RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks);
float far = (float) ((RenderUtil.getFarClipPlaneDistanceInBlocks() + LodUtil.REGION_WIDTH) * Math.sqrt(2));
Mat4f invertedPerspective = new Mat4f(projection); // clone to prevent messing with the original matrix
Mat4f perspective = Mat4f.perspective(
(float) MC_RENDER.getFov(partialTicks),
width / (float) height,
near, far);
Mat4f invertedPerspective = new Mat4f(perspective);
invertedPerspective.invert();
int sampleCount = Config.Client.Advanced.Graphics.Ssao.sampleCount.get();
@@ -215,7 +220,7 @@ public class SSAORenderer
float bias = Config.Client.Advanced.Graphics.Ssao.bias.get().floatValue();
this.ssaoShader.bind();
this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, projection);
this.ssaoShader.setUniform(this.ssaoShaderUniforms.gProjUniform, perspective);
this.ssaoShader.setUniform(this.ssaoShaderUniforms.gInvProjUniform, invertedPerspective);
this.ssaoShader.setUniform(this.ssaoShaderUniforms.gSampleCountUniform, sampleCount);
this.ssaoShader.setUniform(this.ssaoShaderUniforms.gRadiusUniform, radius);