Skip to content

Commit

Permalink
Don't apply blindness incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
leo60228 committed Jan 3, 2023
1 parent 541845b commit 890a3b9
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 19 deletions.
4 changes: 1 addition & 3 deletions shaders/gbuffers_basic.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -23,5 +21,5 @@ void main()

//Output the result.
/*DRAWBUFFERS:0*/
gl_FragData[0] = col * vec4(vec3(1.-blindness),1);
gl_FragData[0] = col;
}
6 changes: 1 addition & 5 deletions shaders/gbuffers_clouds.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions shaders/gbuffers_damagedblock.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 1 addition & 5 deletions shaders/gbuffers_skytextured.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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*/
Expand Down
5 changes: 1 addition & 4 deletions shaders/gbuffers_textured.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
Expand Down

0 comments on commit 890a3b9

Please sign in to comment.