Skip to content
Snippets Groups Projects
Commit a7c47344 authored by NiranV's avatar NiranV
Browse files

Fixed: Global Light setting not working.

parent 028613df
No related branches found
No related tags found
No related merge requests found
......@@ -43,6 +43,9 @@ uniform vec2 screen_res;
uniform float far_z;
uniform mat4 inv_proj;
//BD
uniform float global_light_strength;
in vec4 vary_fragcoord;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
......@@ -167,6 +170,9 @@ void main()
}
}
//BD
final_color *= global_light_strength;
frag_color.rgb = max(final_color, vec3(0));
frag_color.a = 0.0;
......
......@@ -50,6 +50,9 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
uniform vec4 viewport;
//BD
uniform float global_light_strength;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity);
......@@ -144,6 +147,9 @@ void main()
}
}
//BD
final_color *= global_light_strength;
frag_color.rgb = max(final_color, vec3(0));
frag_color.a = 0.0;
}
......@@ -69,6 +69,9 @@ uniform vec2 screen_res;
uniform mat4 inv_proj;
//BD
uniform float global_light_strength;
void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float nh, out float nl, out float nv, out float vh, out float lightDist);
float calcLegacyDistanceAttenuation(float distance, float falloff);
bool clipProjectedLightVars(vec3 center, vec3 pos, out float dist, out float l_dist, out vec3 lv, out vec4 proj_tc );
......@@ -261,6 +264,9 @@ void main()
//not sure why, but this line prevents MATBUG-194
final_color = max(final_color, vec3(0.0));
//BD
final_color *= global_light_strength;
//output linear
frag_color.rgb = final_color;
frag_color.a = 0.0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment