Draw.SolidMesh culling

Hi,
I’m retrofitting an existing script that uses gizmos to draw a mesh to use aline (for the overlap color change mainly), but I’m having some issues with the renderer being “culled” for lack of a better word
I’m using the MonoBehaviourGizmos and the DrawGizmos is being called even if the mesh is not rendered, so I believe this to be an ALINE issue of some sort

Issue is with the white overlay that keeps disappearing, the other mesh is drawn using a regular MeshRenderer
The mesh is generated in global space, so this is simply a swap from Gizmos.DrawMesh to Draw.SolidMesh, no position/rotate/scale going on
This is in scene view

Any ideas?

Hi

Are you using any other drawing commands (in the whole frame)?
Can you replicate it even if you reduce it down to just that draw call?

No other aline draw calls in the frame, no
It’s an empty scene with just that object

Hi

Are you sure the bounding box for that mesh is correct? SolidMesh uses the mesh.bounds property to figure out when to use culling. Try to call mesh.RecalculateBounds()

Sorry, got distracted working on another area
I’ll give that a try once I revisit it - seems like that’d be a very good guess

1 Like