mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-06 07:50:22 +01:00
Fix the bug of shader effect (#1198)
The normal was not calculated correctly Remove extra parenthesis
This commit is contained in:
@@ -28,7 +28,7 @@ void fragment() {
|
||||
ALBEDO = center.rgb;
|
||||
ALPHA = center.a;
|
||||
vec3 normal_tex = texture(normal_map, UV).rgb;
|
||||
normal_tex = -(normal_tex * 2.0 - 1.0);
|
||||
normal_tex = normal_tex * 2.0 - 1.0;
|
||||
NORMAL = normalize(TANGENT * normal_tex.x + BINORMAL * normal_tex.y + NORMAL * normal_tex.z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ void fragment() {
|
||||
outline += step(threshold, texture(texture_albedo, uv - vec2(0.0, outline_thickness)).a);
|
||||
|
||||
vec3 normal_tex = texture(normal_map, UV).rgb;
|
||||
normal_tex = -(normal_tex * 2.0 - 1.0);
|
||||
normal_tex = normal_tex * 2.0 - 1.0;
|
||||
NORMAL = normalize(TANGENT * normal_tex.x + BINORMAL * normal_tex.y + NORMAL * normal_tex.z);
|
||||
|
||||
if (center.a < threshold && outline > 0.0) {
|
||||
|
||||
@@ -33,7 +33,7 @@ void fragment() {
|
||||
ALBEDO = center.rgb;
|
||||
ALPHA = center.a;
|
||||
vec3 normal_tex = texture(normal_map, UV).rgb;
|
||||
normal_tex = -(normal_tex * 2.0 - 1.0);
|
||||
normal_tex = normal_tex * 2.0 - 1.0;
|
||||
NORMAL = normalize(TANGENT * normal_tex.x + BINORMAL * normal_tex.y + NORMAL * normal_tex.z);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user