You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-28 16:07:14 +00:00
Merge pull request #44293 from lawnjelly/normal_compression
Fix bug in normal map decompression
This commit is contained in:
@@ -455,7 +455,7 @@ void main() {
|
|||||||
|
|
||||||
if (use_default_normal) {
|
if (use_default_normal) {
|
||||||
normal.xy = texture2D(normal_texture, uv).xy * 2.0 - 1.0;
|
normal.xy = texture2D(normal_texture, uv).xy * 2.0 - 1.0;
|
||||||
normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
|
normal.z = sqrt(max(0.0, 1.0 - dot(normal.xy, normal.xy)));
|
||||||
normal_used = true;
|
normal_used = true;
|
||||||
} else {
|
} else {
|
||||||
normal = vec3(0.0, 0.0, 1.0);
|
normal = vec3(0.0, 0.0, 1.0);
|
||||||
|
|||||||
@@ -549,7 +549,7 @@ void main() {
|
|||||||
|
|
||||||
if (use_default_normal) {
|
if (use_default_normal) {
|
||||||
normal.xy = textureLod(normal_texture, uv, 0.0).xy * 2.0 - 1.0;
|
normal.xy = textureLod(normal_texture, uv, 0.0).xy * 2.0 - 1.0;
|
||||||
normal.z = sqrt(1.0 - dot(normal.xy, normal.xy));
|
normal.z = sqrt(max(0.0, 1.0 - dot(normal.xy, normal.xy)));
|
||||||
normal_used = true;
|
normal_used = true;
|
||||||
} else {
|
} else {
|
||||||
normal = vec3(0.0, 0.0, 1.0);
|
normal = vec3(0.0, 0.0, 1.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user