aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/neodymium
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-30 12:32:20 +0200
committermakamys <makamys@outlook.com>2022-06-30 12:32:20 +0200
commitc25a4aa69cbababb6c961bcb665841db3ebf127d (patch)
treebe949a9974f525cf911078da3c3404d182a2615d /src/main/java/makamys/neodymium
parent88622cb5c118bb73a30da4716f8e4f8c677622a7 (diff)
downloadNeodymium-c25a4aa69cbababb6c961bcb665841db3ebf127d.tar.gz
Neodymium-c25a4aa69cbababb6c961bcb665841db3ebf127d.tar.bz2
Neodymium-c25a4aa69cbababb6c961bcb665841db3ebf127d.zip
Implement exponential fog
Diffstat (limited to 'src/main/java/makamys/neodymium')
-rw-r--r--src/main/java/makamys/neodymium/renderer/NeoRenderer.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
index 6a1c1e9..8d15eed 100644
--- a/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
+++ b/src/main/java/makamys/neodymium/renderer/NeoRenderer.java
@@ -332,6 +332,8 @@ public class NeoRenderer {
int u_projInv = glGetUniformLocation(shaderProgram, "projInv");
int u_fogColor = glGetUniformLocation(shaderProgram, "fogColor");
int u_fogStartEnd = glGetUniformLocation(shaderProgram, "fogStartEnd");
+ int u_fogMode = glGetUniformLocation(shaderProgram, "fogMode");
+ int u_fogDensity = glGetUniformLocation(shaderProgram, "fogDensity");
glUniformMatrix4(u_modelView, false, modelView);
glUniformMatrix4(u_proj, false, projBuf);
@@ -339,6 +341,8 @@ public class NeoRenderer {
glUniform4f(u_viewport, viewportBuf.get(0),viewportBuf.get(1),viewportBuf.get(2),viewportBuf.get(3));
glUniform4(u_fogColor, fogColorBuf);
glUniform2(u_fogStartEnd, fogStartEnd);
+ glUniform1i(u_fogMode, glGetInteger(GL_FOG_MODE));
+ glUniform1f(u_fogDensity, glGetFloat(GL_FOG_DENSITY));
glUniform3f(u_playerPos, (float)eyePosX, (float)eyePosY, (float)eyePosZ);