Search Issue Tracker
Won't Fix
Votes
3
Found in
5.3.4f1
Issue ID
794020
Regression
No
Graphics.DrawMesh does not handle mirror (negative scale) transforms well, should flip backface culling properly
Steps to reproduce:
1. Open attached project
2. Open scene "Exmaple"
3. Select "Main Camera" and notice that Scale specified in Draw Mesh Scale component uses one negative value
4. Run scene and notice that normals of mesh are messed up
Reproduced with: 5.2.4f1, 5.3.4p6, 5.4.0.b18
Comments (3)
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
- Project Auditor Analysis is not marked dirty when the save file is deleted even after reopening the Project Auditor window
- “Shader Graphs” text in the blackboard is hard to see
- "NullReferenceException" error is thrown when changing input field focus via script with custom validation
- The Tables in the Project Auditor’s Assemblies, and Precompiled Assemblies tabs does not scale with the Project Auditor window size which leads to unused empty space and bigger scrollbars in the tables
- Tile Palette button with longer Palette name is misaligned and cut-off when Tile Palette Clipboard overlay is resized
MUGIK
Jan 25, 2021 18:27
I had overcome this issue by using this code:
Matrix4x4 matrix = ... object's localToWorlMatrix ...;
Vector3 s = matrix.lossyScale;
bool needToInvertCulling = Mathf.Sign(s.x * s.y * s.z) < 0;
CommandBuffer.SetInvertCulling( needToInvertCulling );
hedgehog90
Oct 14, 2016 16:24
Please add a feature that allows Graphics.DrawMesh to flip normals
z_blush
May 25, 2016 20:17
I am running into a similar issue with a skinned 2d character (polygon planes skinned to joints). Here is an example:
Often, the character is scaled to -1 on X to flip it. The scale happens on the root joint of the character which has no skin influence on the polygons. In this case, all meshes draw perfectly in positive and negative scale space. However, if a child joint which has influence on a mesh is scaled to -1 on X, the affected mesh is drawn in reverse space (the normals are pointing in the opposite direction of the other meshes) - essentially the same problem of backface culling not flipping.