aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormakamys <makamys@outlook.com>2022-06-19 21:12:42 +0200
committermakamys <makamys@outlook.com>2022-06-19 21:12:42 +0200
commita621264ea3bbeab895b561c32ec0974e0fd58a9e (patch)
tree0ef7296b6e7c374d9d18923365926778db63d34f /src
parent2873cbc1adf5fbdbc526d623cc992c4214482af8 (diff)
downloadNeodymium-a621264ea3bbeab895b561c32ec0974e0fd58a9e.tar.gz
Neodymium-a621264ea3bbeab895b561c32ec0974e0fd58a9e.tar.bz2
Neodymium-a621264ea3bbeab895b561c32ec0974e0fd58a9e.zip
Make fog work again
Diffstat (limited to 'src')
-rw-r--r--src/main/resources/shaders/chunk_fog.frag12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/resources/shaders/chunk_fog.frag b/src/main/resources/shaders/chunk_fog.frag
index 160ae65..ade0881 100644
--- a/src/main/resources/shaders/chunk_fog.frag
+++ b/src/main/resources/shaders/chunk_fog.frag
@@ -4,18 +4,26 @@ out vec4 FragColor;
in vec2 TexCoord;
in vec2 BTexCoord;
in vec4 Color;
+in vec4 SPos;
in vec4 Viewport;
in mat4 ProjInv;
in vec4 FogColor;
in vec2 FogStartEnd;
in float FogFactor;
+flat in vec2 ProvokingTexCoord;
uniform sampler2D atlas;
uniform sampler2D lightTex;
void main()
-{
- vec4 texColor = texture(atlas, TexCoord);
+{
+ float wrappedU = mod(SPos.x, 1.0);
+ float wrappedV = mod(SPos.y, 1.0);
+
+ vec2 goodTexCoord = ProvokingTexCoord.xy + (((TexCoord.xy - ProvokingTexCoord.xy) / SPos.zw) * vec2(wrappedU, wrappedV));
+
+ vec4 texColor = texture(atlas, goodTexCoord);
+
vec4 colorMult = Color/256.0;
vec4 lightyColor = texture(lightTex, (BTexCoord + 8.0) / 256.0);