Skip to content

Commit

Permalink
Merge pull request #100859 from StaydMcMuffin/scene-shaders-user-norm…
Browse files Browse the repository at this point in the history
…al-fix

Fix User-supplied Normals Being Ignored
  • Loading branch information
Repiteo committed Dec 30, 2024
2 parents df2b117 + 40f1712 commit 58b48a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,6 @@ void main() {
normal = -normal;
}
#endif // DO_SIDE_CHECK
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifdef UV_USED
Expand Down Expand Up @@ -1882,6 +1881,10 @@ void main() {
#endif //USE_MULTIVIEW
#endif //LIGHT_VERTEX_USED

#ifdef NORMAL_USED
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifndef USE_SHADOW_TO_OPACITY

#if defined(ALPHA_SCISSOR_USED)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,6 @@ void fragment_shader(in SceneData scene_data) {
normal = -normal;
}
#endif // DO_SIDE_CHECK
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifdef UV_USED
Expand Down Expand Up @@ -1254,6 +1253,10 @@ void fragment_shader(in SceneData scene_data) {
#endif //USE_MULTIVIEW
#endif //LIGHT_VERTEX_USED

#ifdef NORMAL_USED
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifndef USE_SHADOW_TO_OPACITY

#ifdef ALPHA_SCISSOR_USED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,6 @@ void main() {
normal = -normal;
}
#endif // DO_SIDE_CHECK
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifdef UV_USED
Expand Down Expand Up @@ -975,6 +974,10 @@ void main() {
#endif //USE_MULTIVIEW
#endif //LIGHT_VERTEX_USED

#ifdef NORMAL_USED
vec3 geo_normal = normalize(normal);
#endif // NORMAL_USED

#ifdef LIGHT_TRANSMITTANCE_USED
#ifdef SSS_MODE_SKIN
transmittance_color.a = sss_strength;
Expand Down

0 comments on commit 58b48a9

Please sign in to comment.