Skip to content

Commit c1526cc

Browse files
author
TehcJS
committed
fix bugs, organize code
1 parent 9e750cb commit c1526cc

File tree

7 files changed

+3
-37
lines changed

7 files changed

+3
-37
lines changed

shaders/gbuffers_clouds.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#define FRAG
44
#define DEFAULT
55
#define TEXTURED
6-
#define BLINDNESS
76
#define FOG
87

98
#include "/program/base.glsl"

shaders/gbuffers_entities.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@
66
#define TEXTURED
77
#define ENTITY_COLOR
88
#define FOG
9-
#define BLINDNESS
109

1110
#include "/program/base.glsl"

shaders/gbuffers_glint.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
#define LIGHTMAP
66
#define TEXTURED
77
#define FOG
8-
#define BLINDNESS
98

109
#include "/program/base.glsl"

shaders/gbuffers_skytextured.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
#define FRAG
44
#define DEFAULT
55
#define TEXTURED
6-
#define BLINDNESS
76

87
#include "/program/base.glsl"

shaders/gbuffers_terrain.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@
55
#define TEXTURED
66
#define LIGHTMAP
77
#define FOG
8-
#define BLINDNESS
98

109
#include "/program/base.glsl"

shaders/program/base.glsl

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ void main() {
8080

8181

8282
// Options
83-
// #define FOG_DENSITY 0.7 // [0, 1]
84-
// #define FLUID_FOG_DENSITY 0.5 // [0, 1]
8583
// #define DEBUG
8684

8785
// Preprocessors
@@ -91,20 +89,13 @@ void main() {
9189
#include "/lib/common.glsl"
9290

9391
// Constants
94-
/*
95-
// const bool gaux1Clear = false;
96-
*/
9792

9893
// Uniforms
9994
uniform sampler2D lightmap;
100-
uniform float blindness;
101-
// TODO: change this to gtexture in iris 1.1.2
10295
uniform sampler2D gtexture;
10396
uniform vec4 entityColor;
10497
uniform vec3 fogColor;
10598
uniform vec3 skyColor;
106-
// uniform float fogStart;
107-
// uniform float fogEnd;
10899
uniform float far;
109100
uniform int isEyeInWater;
110101

@@ -123,25 +114,17 @@ RenderResult render() {
123114
#endif
124115

125116
vec3 light;
126-
float brightness; // how bright the light is
127-
128-
// apply blindness effect
129-
#if defined(BLINDNESS)
130-
brightness = 1 - blindness;
131-
#else
132-
brightness = 1;
133-
#endif
134117

135118
// calculate lighting
136119
#if defined(LIGHTMAP)
137120
// https://github.com/XorDev/XorDevs-Default-Shaderpack/blob/c13319fb7ca1a178915fba3b18dee47c54903cc3/shaders/gbuffers_textured.fsh#L35
138121
// combine the lightmap with blindness
139-
light = brightness * texture(lightmap, lmcoord).rgb;
122+
light = texture(lightmap, lmcoord).rgb;
140123
#else
141124
light = vec3(1);
142125
#endif
143126

144-
color *= vec4(light, 1);
127+
color.rgb *= light;
145128

146129
// apply mob entity flashes
147130
#if defined(ENTITY_COLOR)
@@ -154,21 +137,11 @@ RenderResult render() {
154137
// calculate fog
155138
float fog = smoothstep(gl_Fog.start, gl_Fog.end, vertDist);
156139

157-
// Note: I disabled this in favor of vanilla's fog color.
158-
// mix fog color with sky color
159-
// if (isEyeInWater == 0) {
160-
// color.rgb = mix(color.rgb, skyColor.rgb, fog);
161-
// }
162-
// color.rgb = mix(color.rgb, fogColor.rgb, fog);
163140
color.rgb = mix(color.rgb, fogColor.rgb, fog);
164141

165142
// squares for debugging
166143
#ifdef DEBUG
167-
if (gl_FragCoord.x >= 1499 && gl_FragCoord.y >= 800) {
168-
color.rgb = vec3(gl_Fog.start);
169-
} else if (gl_FragCoord.x >= 1499 && gl_FragCoord.y >= 700 && gl_FragCoord.y <= 800) {
170-
color.rgb = vec3(gl_Fog.end);
171-
}
144+
color.rgb = vec3(blindness);
172145
#endif
173146
#endif
174147

shaders/shader.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
screen=[FOG]
22
screen.FOG=FOG_DENSITY FLUID_FOG_DENSITY
3-
4-
# variable.bool.isSwampBiome=biome_category == CAT_SWAMP

0 commit comments

Comments
 (0)