mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fix handling of normals that approach 1
This commit is contained in:
parent
64595f0f6a
commit
66eba18969
2 changed files with 2 additions and 2 deletions
|
|
@ -1700,7 +1700,7 @@ FRAGMENT_SHADER_CODE
|
|||
#if defined(ENABLE_NORMALMAP)
|
||||
|
||||
normalmap.xy=normalmap.xy*2.0-1.0;
|
||||
normalmap.z=sqrt(1.0-dot(normalmap.xy,normalmap.xy)); //always ignore Z, as it can be RG packed, Z may be pos/neg, etc.
|
||||
normalmap.z=sqrt(max(0.0, 1.0-dot(normalmap.xy,normalmap.xy))); //always ignore Z, as it can be RG packed, Z may be pos/neg, etc.
|
||||
|
||||
normal = normalize( mix(normal_interp,tangent * normalmap.x + binormal * normalmap.y + normal * normalmap.z,normaldepth) ) * side;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue