Skip to content

Commit f104198

Browse files
committed
Tweaked normal in main shader
1 parent fb792ef commit f104198

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

resources/shaders/forward/lighting_poly.frag

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ out vec4 o_Color;
4343
const float EDGE_WIDTH = 0.25;
4444
const float SPOKE_WIDTH = 0.1;
4545
const float BASE_ALPHA = 0.0;
46+
const float NORMAL_SLOPE = 0.75;
4647

4748
void main() {
4849
vec4 kd = vec4(0.2, 0.2, 0.2, 1.0);
@@ -67,7 +68,7 @@ void main() {
6768
vec4 color_specular = vec4(0,0,0,1);
6869
vec4 highlight_color = u_Emissive * e * f * 4.0;
6970

70-
vec3 normal = v_In.TBN * vec3(dx, dy, sqrt(1 - r));
71+
vec3 normal = normalize(v_In.TBN * vec3(dx, dy, NORMAL_SLOPE * sqrt(1 - r)));
7172

7273
for (int i = 0; i < u_LightCount; i++) {
7374
vec4 delta = light[i].center - v_In.Position;

0 commit comments

Comments
 (0)