remove some unneeded fog code in the main shader program
This commit is contained in:
+9
-6
@@ -66,7 +66,7 @@ public class LodRenderProgram extends ShaderProgram
|
||||
// Debug Uniform
|
||||
public final int whiteWorldUniform;
|
||||
|
||||
public final LodFogConfig fogConfig;
|
||||
private final LodFogConfig fogConfig;
|
||||
|
||||
// This will bind VertexAttribute
|
||||
public LodRenderProgram(LodFogConfig fogConfig) {
|
||||
@@ -125,9 +125,13 @@ public class LodRenderProgram extends ShaderProgram
|
||||
}
|
||||
|
||||
// If not usable, return a new LodFogConfig to be constructed
|
||||
public LodFogConfig isShaderUsable() {
|
||||
public LodFogConfig isShaderUsable() // TODO replace with a config listener, look at LodFogConfig for more info
|
||||
{
|
||||
LodFogConfig newConfig = LodFogConfig.generateFogConfig();
|
||||
if (fogConfig.equals(newConfig)) return null;
|
||||
if (fogConfig.equals(newConfig))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return newConfig;
|
||||
}
|
||||
|
||||
@@ -156,9 +160,8 @@ public class LodRenderProgram extends ShaderProgram
|
||||
vao.unbindBuffersFromAllBindingPoint();
|
||||
}
|
||||
|
||||
public void fillUniformData(Mat4f combinedMatrix, Color fogColor,
|
||||
int lightmapBindPoint, int worldHeight, int worldYOffset, int lodDrawDistance,
|
||||
int vanillaDrawDistance, boolean fullFogMode) {
|
||||
public void fillUniformData(Mat4f combinedMatrix, int lightmapBindPoint, int worldYOffset, int vanillaDrawDistance)
|
||||
{
|
||||
super.bind();
|
||||
vanillaDrawDistance += 32; // Give it a 2 chunk boundary for near fog.
|
||||
// uniforms
|
||||
|
||||
@@ -229,11 +229,8 @@ public class LodRenderer
|
||||
Mat4f modelViewProjectionMatrix = RenderUtil.createCombinedModelViewProjectionMatrix(baseProjectionMatrix, baseModelViewMatrix, partialTicks);
|
||||
|
||||
/*---------Fill uniform data--------*/
|
||||
// Fill the uniform data. Note: GL33.GL_TEXTURE0 == texture bindpoint 0
|
||||
this.shaderProgram.fillUniformData(modelViewProjectionMatrix,
|
||||
MC_RENDER.isFogStateSpecial() ? this.getSpecialFogColor(partialTicks) : this.getFogColor(partialTicks),
|
||||
0, MC.getWrappedClientWorld().getHeight(), MC.getWrappedClientWorld().getMinHeight(), RenderUtil.getFarClipPlaneDistanceInBlocks(),
|
||||
vanillaBlockRenderedDistance, MC_RENDER.isFogStateSpecial());
|
||||
this.shaderProgram.fillUniformData(modelViewProjectionMatrix, /*Light map = GL_TEXTURE0*/ 0,
|
||||
MC.getWrappedClientWorld().getMinHeight(), vanillaBlockRenderedDistance);
|
||||
|
||||
// Note: Since lightmapTexture is changing every frame, it's faster to recreate it than to reuse the old one.
|
||||
ILightMapWrapper lightmap = MC_RENDER.getLightmapWrapper();
|
||||
|
||||
Reference in New Issue
Block a user