mirror of
https://github.com/godotengine/godot.git
synced 2025-02-11 22:35:15 +08:00
Fix User-supplied Normals Being Ignored
Moves the initialization of the geo_normal value to after the user shader code, so that the normal supplied by the user is actually used instead of the interpolated vertex normal.
This commit is contained in:
parent
a7a2a12bfd
commit
40f17127ef
@ -1816,7 +1816,6 @@ void main() {
|
||||
normal = -normal;
|
||||
}
|
||||
#endif // DO_SIDE_CHECK
|
||||
vec3 geo_normal = normalize(normal);
|
||||
#endif // NORMAL_USED
|
||||
|
||||
#ifdef UV_USED
|
||||
@ -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)
|
||||
|
@ -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
|
||||
@ -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
|
||||
|
@ -898,7 +898,6 @@ void main() {
|
||||
normal = -normal;
|
||||
}
|
||||
#endif // DO_SIDE_CHECK
|
||||
vec3 geo_normal = normalize(normal);
|
||||
#endif // NORMAL_USED
|
||||
|
||||
#ifdef UV_USED
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user