Skip to content

Commit 0837034

Browse files
committed
Ignore lightx 0
1 parent 4bbb56a commit 0837034

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

assets/lumi/shaders/pass/color.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void main()
9898
tempPos = frx_inverseViewProjectionMatrix * vec4(2.0 * v_texcoord - 1.0, 2.0 * dMin - 1.0, 1.0);
9999
eyePos = tempPos.xyz / tempPos.w;
100100

101-
light = vec4(0.0, 1.0, 0.0, 0.0);
101+
light = vec4(0.0);
102102
material = vec3(1.0, 0.0, 0.04);
103103
normal = -frx_cameraView;
104104

assets/lumi/shaders/prog/shading.glsl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ vec3 lightPbr(vec3 albedo, float alpha, vec3 radiance, float roughness, float me
162162

163163
vec4 shading(vec4 color, sampler2D natureTexture, vec4 light, float ao, vec3 material, vec3 eyePos, vec3 normal, bool isUnderwater)
164164
{
165+
vec3 albedo = hdr_fromGamma(color.rgb);
166+
167+
// unmanaged
168+
if (light.x == 0.0) return vec4(albedo, color.a);
169+
165170
float causticLight = 0.0;
166171

167172
#ifdef WATER_CAUSTICS
@@ -190,7 +195,6 @@ vec4 shading(vec4 color, sampler2D natureTexture, vec4 light, float ao, vec3 mat
190195

191196
light.z += vanillaEmissive;
192197

193-
vec3 albedo = hdr_fromGamma(color.rgb);
194198
vec3 f0 = mix(vec3(material.z), albedo, material.y); // TODO: multiply metallic f0?
195199

196200
vec3 toEye = -normalize(eyePos);

0 commit comments

Comments
 (0)