Search Issue Tracker
By Design
Votes
0
Found in
2022.3.19f1
2023.2.9f1
2023.3.0b6
6000.0.0b11
Issue ID
UUM-62803
Regression
No
Artifacts are visible on meshes when Triplanar normal sampling is used
Reproduction steps:
1. Open the attached “UnityBugTriplanarUVScaling.zip” project
2. Open the “OutdoorsScene” Scene
3. Observe the “cube_suvscale0 (1)” GameObject
Expected result: GameObject is rendered with no artifacts
Actual result: Artifacts are visible on 2 of the GameObject’s faces
Reproducible with: 2022.3.19f1, 2023.2.9f1, 2023.3.0b6
Couldn’t test with: 2021.3.34f1 (Unfixable compiler errors due to downgrading)
Reproducible on: Windows 11
Not reproducible on: no other environment tested
Notes:
- Enabling any form of vertex compression in the import settings, fixes the issue
- For reproduction, faces need to face exactly +X or -X on import, and the UV of these faces needs to be scaled down to a single point
- Not reproducible with the standard HDRP Lit Shader or with non-normal textures
- “cube.fbx” GameObject is the default Blender cube, “cube_uvscale0.fbx” is the same cube but with all UV faces scaled to a single point
- The normals are wrong on the “cube_uvscale0” GameObject too but the bug is harder to see there. It is visible though in the rendering debugger
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
I took a look at the sample project.
In addition to the particular UV setup, the tangent vectors of the mesh are broken: they always point along the x-axis (1,0,0), regardless of the vertex normal. These tangent vectors are used to form the tangent frame, which is also broken if the normal and the tangent vectors are collinear.
If you take a look at the shader graph, you will notice that the fragment shader only accepts the normal in the tangent space. That is an old (and rather unfortunate) decision that has not been made by me. As a result, normal mapping cannot be done correctly if the tangent frame is broken.
Of course, triplanar mapping by itself has nothing to do with the tangent frame.
However, given the current design of the shader graph (and its limitations), we require a valid tangent frame.
It would be nice if triplanar normal mapping worked without the tangent frame. However, our bug report system is not the right place to make feature requests.
Finally, I encourage you to check out the surface gradient bump mapping package: https://docs.unity3d.com/Packages/com.unity.surface-gradient-bump-mapping@0.2/manual/index.html It may resolve some of your issues.