From 890a3b9782900dd957ea91fb8fc08fc1818f1ba2 Mon Sep 17 00:00:00 2001 From: leo60228 Date: Tue, 3 Jan 2023 16:01:08 -0500 Subject: [PATCH] Don't apply blindness incorrectly --- shaders/gbuffers_basic.fsh | 4 +--- shaders/gbuffers_clouds.fsh | 6 +----- shaders/gbuffers_damagedblock.fsh | 2 -- shaders/gbuffers_skytextured.fsh | 6 +----- shaders/gbuffers_textured.fsh | 5 +---- 5 files changed, 4 insertions(+), 19 deletions(-) diff --git a/shaders/gbuffers_basic.fsh b/shaders/gbuffers_basic.fsh index b20347c..9344816 100644 --- a/shaders/gbuffers_basic.fsh +++ b/shaders/gbuffers_basic.fsh @@ -2,8 +2,6 @@ // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. -//0-1 amount of blindness. -uniform float blindness; //0 = default, 1 = water, 2 = lava. uniform int isEyeInWater; @@ -23,5 +21,5 @@ void main() //Output the result. /*DRAWBUFFERS:0*/ - gl_FragData[0] = col * vec4(vec3(1.-blindness),1); + gl_FragData[0] = col; } diff --git a/shaders/gbuffers_clouds.fsh b/shaders/gbuffers_clouds.fsh index 3a121f7..b6a7667 100644 --- a/shaders/gbuffers_clouds.fsh +++ b/shaders/gbuffers_clouds.fsh @@ -5,8 +5,6 @@ //Diffuse (color) texture. uniform sampler2D texture; -//0-1 amount of blindness. -uniform float blindness; //0 = default, 1 = water, 2 = lava. uniform int isEyeInWater; @@ -17,10 +15,8 @@ varying vec2 coord0; void main() { - //Visibility amount. - vec3 light = vec3(1.-blindness); //Sample texture times Visibility. - vec4 col = color * vec4(light,1) * texture2D(texture,coord0); + vec4 col = color * texture2D(texture,coord0); //Calculate fog intensity in or out of water. float fog = (isEyeInWater>0) ? 1.-exp(-gl_FogFragCoord * gl_Fog.density): diff --git a/shaders/gbuffers_damagedblock.fsh b/shaders/gbuffers_damagedblock.fsh index 564f8dc..b57b7a4 100644 --- a/shaders/gbuffers_damagedblock.fsh +++ b/shaders/gbuffers_damagedblock.fsh @@ -7,8 +7,6 @@ uniform sampler2D texture; //Lighting from day/night + shadows + light sources. uniform sampler2D lightmap; -//0-1 amount of blindness. -uniform float blindness; //0 = default, 1 = water, 2 = lava. uniform int isEyeInWater; diff --git a/shaders/gbuffers_skytextured.fsh b/shaders/gbuffers_skytextured.fsh index ff32944..c8705d1 100644 --- a/shaders/gbuffers_skytextured.fsh +++ b/shaders/gbuffers_skytextured.fsh @@ -5,8 +5,6 @@ //Diffuse (color) texture. uniform sampler2D texture; -//0-1 amount of blindness. -uniform float blindness; //0 = default, 1 = water, 2 = lava. uniform int isEyeInWater; @@ -17,10 +15,8 @@ varying vec2 coord0; void main() { - //Visibility amount. - vec3 light = vec3(1.-blindness); //Sample texture times Visibility. - vec4 col = color * vec4(light,1) * texture2D(texture,coord0); + vec4 col = color * texture2D(texture,coord0); //Output the result. /*DRAWBUFFERS:0*/ diff --git a/shaders/gbuffers_textured.fsh b/shaders/gbuffers_textured.fsh index c9a1999..b89aec0 100644 --- a/shaders/gbuffers_textured.fsh +++ b/shaders/gbuffers_textured.fsh @@ -9,8 +9,6 @@ uniform sampler2D lightmap; //RGB/intensity for hurt entities and flashing creepers. uniform vec4 entityColor; -//0-1 amount of blindness. -uniform float blindness; //0 = default, 1 = water, 2 = lava. uniform int isEyeInWater; @@ -22,8 +20,7 @@ varying vec2 coord1; void main() { - //Combine lightmap with blindness. - vec3 light = (1.-blindness) * texture2D(lightmap,coord1).rgb; + vec3 light = texture2D(lightmap,coord1).rgb; //Sample texture times lighting. vec4 col = color * vec4(light,1) * texture2D(texture,coord0); //Apply entity flashes.