- Home /
Override a bounding box
Hello,
I have a mesh that is rendered with a vertex shader with custom matrices that completely modifies its position. The default bounding box of the object (renderer.bounds) no longer represent the resulting bounds of the object and it is frustum culled when rendered whereas it should be visible.
Is there a way to override the current bounding box of an object or disable the frustum culling for this object (tell Unity to always render this object) ? The renderer.bounds property is Read-Only.
Currenty I will have to render the mesh manually with Graphics.DrawMeshNow but this is not really convenient.
Answer by Owen-Reynolds · Sep 13, 2011 at 02:38 PM
It looks like Mesh.bounds
is writable. I'd guess Renderer.bounds is a pointer to that, which is why it's read only. Docs suggest Mesh.bounds are only autocalced when you assign triangles (since you need to explicitly call Mesh.RecalculateBounds if you modify Mesh.verts.)
I'd think setting Mesh.bounds
to to include the max displacements should solve it.
Answer by Oleg · Nov 16, 2011 at 05:37 PM
I've got the same problem. RecalculateBounds doesn't work to me.
Your answer
![](https://koobas.hobune.stream/wayback/20220612211846im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How do I keep an Ortho camera in a specific range when the ortho changes? 3 Answers
3d Text how do you autofit to a fixed space 0 Answers
How to get correct position after RecalculateBounds is called? 1 Answer
Issue with bounds.SetMinMax assigning incorrectly. 1 Answer
How to stop view from scrolling when edge of view collides with a game object? 0 Answers