default viewport
This commit is contained in:
+5
@@ -22,6 +22,7 @@ package com.seibel.distanthorizons.core.render.renderer.shaders;
|
||||
import com.seibel.distanthorizons.core.dependencyInjection.SingletonInjector;
|
||||
import com.seibel.distanthorizons.core.render.glObject.shader.ShaderProgram;
|
||||
import com.seibel.distanthorizons.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
|
||||
import org.lwjgl.opengl.GL32;
|
||||
|
||||
public abstract class AbstractShaderRenderer
|
||||
{
|
||||
@@ -51,6 +52,10 @@ public abstract class AbstractShaderRenderer
|
||||
|
||||
this.onApplyUniforms(partialTicks);
|
||||
|
||||
int width = MC_RENDER.getTargetFrameBufferViewportWidth();
|
||||
int height = MC_RENDER.getTargetFrameBufferViewportHeight();
|
||||
GL32.glViewport(0, 0, width, height);
|
||||
|
||||
this.onRender();
|
||||
|
||||
this.shader.unbind();
|
||||
|
||||
+1
-5
@@ -50,11 +50,7 @@ public class DarkShader extends AbstractShaderRenderer
|
||||
protected void onRender()
|
||||
{
|
||||
GLState state = new GLState();
|
||||
|
||||
int width = MC_RENDER.getTargetFrameBufferViewportWidth();
|
||||
int height = MC_RENDER.getTargetFrameBufferViewportHeight();
|
||||
|
||||
GL32.glViewport(0, 0, width, height);
|
||||
|
||||
GL32.glDisable(GL32.GL_DEPTH_TEST);
|
||||
GL32.glDisable(GL32.GL_SCISSOR_TEST);
|
||||
GL32.glEnable(GL32.GL_BLEND);
|
||||
|
||||
-4
@@ -154,10 +154,6 @@ public class FogShader extends AbstractShaderRenderer
|
||||
{
|
||||
GLState state = new GLState();
|
||||
|
||||
int width = MC_RENDER.getTargetFrameBufferViewportWidth();
|
||||
int height = MC_RENDER.getTargetFrameBufferViewportHeight();
|
||||
|
||||
GL32.glViewport(0, 0, width, height);
|
||||
GL32.glDisable(GL32.GL_DEPTH_TEST);
|
||||
GL32.glDisable(GL32.GL_SCISSOR_TEST);
|
||||
GL32.glEnable(GL32.GL_BLEND);
|
||||
|
||||
+7
-7
@@ -75,20 +75,20 @@ public class SSAOApplyShader extends AbstractShaderRenderer
|
||||
GL32.glBindTexture(GL32.GL_TEXTURE_2D, this.ssaoTexture);
|
||||
GL32.glUniform1i(this.applyShaderUniforms.gSSAOMapUniform, 1);
|
||||
|
||||
int blurRadius = Config.Client.Advanced.Graphics.Ssao.blurRadius.get();
|
||||
GL32.glUniform1i(this.applyShaderUniforms.gBlurRadiusUniform, blurRadius);
|
||||
GL32.glUniform1i(this.applyShaderUniforms.gBlurRadiusUniform,
|
||||
Config.Client.Advanced.Graphics.Ssao.blurRadius.get());
|
||||
|
||||
if (this.applyShaderUniforms.gViewSizeUniform >= 0)
|
||||
{
|
||||
int width = MC_RENDER.getTargetFrameBufferViewportWidth();
|
||||
int height = MC_RENDER.getTargetFrameBufferViewportHeight();
|
||||
GL32.glUniform2f(this.applyShaderUniforms.gViewSizeUniform, width, height);
|
||||
GL32.glUniform2f(this.applyShaderUniforms.gViewSizeUniform,
|
||||
MC_RENDER.getTargetFrameBufferViewportWidth(),
|
||||
MC_RENDER.getTargetFrameBufferViewportHeight());
|
||||
}
|
||||
|
||||
if (this.applyShaderUniforms.gNearUniform >= 0)
|
||||
{
|
||||
float near = RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks);
|
||||
GL32.glUniform1f(this.applyShaderUniforms.gNearUniform, near);
|
||||
GL32.glUniform1f(this.applyShaderUniforms.gNearUniform,
|
||||
RenderUtil.getNearClipPlaneDistanceInBlocks(partialTicks));
|
||||
}
|
||||
|
||||
if (this.applyShaderUniforms.gFarUniform >= 0)
|
||||
|
||||
-4
@@ -115,11 +115,7 @@ public class SSAOShader extends AbstractShaderRenderer
|
||||
@Override
|
||||
protected void onRender()
|
||||
{
|
||||
int width = MC_RENDER.getTargetFrameBufferViewportWidth();
|
||||
int height = MC_RENDER.getTargetFrameBufferViewportHeight();
|
||||
|
||||
GL32.glBindFramebuffer(GL32.GL_FRAMEBUFFER, this.ssaoFramebuffer);
|
||||
GL32.glViewport(0, 0, width, height);
|
||||
GL32.glDisable(GL32.GL_SCISSOR_TEST);
|
||||
GL32.glDisable(GL32.GL_DEPTH_TEST);
|
||||
GL32.glDisable(GL32.GL_BLEND);
|
||||
|
||||
Reference in New Issue
Block a user