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
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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.