diff options
author | makamys <makamys@outlook.com> | 2022-06-11 13:46:25 +0200 |
---|---|---|
committer | makamys <makamys@outlook.com> | 2022-06-11 13:46:25 +0200 |
commit | d6cc941ea43fc49dc6790b5807d502da9e486bf2 (patch) | |
tree | 5d74febb91146319468f719f1b1c66e5e7f92a1f /src | |
parent | 9888baa0cc89eb077d137c85aa8dda84f27a5fdf (diff) | |
download | Neodymium-d6cc941ea43fc49dc6790b5807d502da9e486bf2.tar.gz Neodymium-d6cc941ea43fc49dc6790b5807d502da9e486bf2.tar.bz2 Neodymium-d6cc941ea43fc49dc6790b5807d502da9e486bf2.zip |
Clean up fragment shader
Diffstat (limited to 'src')
-rw-r--r-- | src/main/resources/shaders/chunk.frag | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/src/main/resources/shaders/chunk.frag b/src/main/resources/shaders/chunk.frag index be904a0..fae64b5 100644 --- a/src/main/resources/shaders/chunk.frag +++ b/src/main/resources/shaders/chunk.frag @@ -16,31 +16,13 @@ uniform sampler2D lightTex; void main() { - float relU = mod(SPos.x, 1.0); - float relV = mod(SPos.y, 1.0); + float wrappedU = mod(SPos.x, 1.0); + float wrappedV = mod(SPos.y, 1.0); - //if(true||relU > 1 || relV > 1){ - if(false){ - //FragColor = vec4(1, 1, 1, 1); - //FragColor = vec4((SPos.x), (SPos.y), 0, 1); - //FragColor = vec4(SPos.xy, 0, 1); - FragColor = vec4(relU, relV, 0, 1); - //FragColor = vec4(abs(TexCoord.x - ProvokingTexCoord.x) * 100.0, abs(TexCoord.y - ProvokingTexCoord.y) * 100.0, 0, 1); - //FragColor = vec4((TexCoord.xy - ProvokingTexCoord.xy) * 100.0, 0, 1); - } else { - - //float goodTexCoordU = ProvokingTexCoord.x + (TexCoord.x - ProvokingTexCoord.x) * relU; - //float goodTexCoordV = ProvokingTexCoord.y + (TexCoord.y - ProvokingTexCoord.y) * relV; - - float goodTexCoordU = ProvokingTexCoord.x + (((TexCoord.x - ProvokingTexCoord.x) / SPos.z) * relU); - float goodTexCoordV = ProvokingTexCoord.y + (((TexCoord.y - ProvokingTexCoord.y) / SPos.w) * relV); - - vec2 goodTexCoord = vec2(goodTexCoordU, goodTexCoordV); - - //vec2 goodTexCoord = ProvokingTexCoord + vec2(SPos.x / 3.0, SPos.y) * (1.0/16.0); + vec2 goodTexCoord = ProvokingTexCoord.xy + (((TexCoord.xy - ProvokingTexCoord.xy) / SPos.zw) * vec2(wrappedU, wrappedV)); vec4 texColor = texture(atlas, goodTexCoord); - //vec4 texColor = texture(atlas, TexCoord); + vec4 colorMult = Color/256.0; vec4 lightyColor = texture(lightTex, (BTexCoord + 8.0) / 256.0); @@ -48,13 +30,4 @@ void main() vec4 rasterColor = ((texColor * colorMult) * lightyColor); FragColor = rasterColor; - - //FragColor = vec4(SPos.z, 1, 1, 1); - - //FragColor = texColor; - //FragColor = vec4(relU, relV, 0, 1); - - } - - //FragColor = vec4(1, 1, 1, 1); } |