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
- Build fails when building a project containing an 18+ dimension array with IL2CPP
- [Android][Sentis] Human poses are not detected when using the BlazePose model
- Sprite Editor Outline Tool Overlay is not displayed when no Sprite is selected
- “No method with RuntimeInitializeOnLoadMethod attribute” warning from ReadmeEditor.cs is thrown after installing Project Auditor Rules
- Projection matrix is altered when using RasterCommandBuffer.ClearRenderTarget on DX12 and Metal
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.