I'm using
Graphics.DrawMesh(mesh, _matrix, material, 0, cam);
and my mesh is too height , so when move camera and when mesh inside in screen , it's not show early. it cullinged. but when I new a Gameobject with MeshRenderer, it's no problem , it culling well, not too early. So what diffrence on here??
And I try to set mesh Bounds like this :
mesh.bounds = new Bounds()
{
center = Vector3.zero,
extents = mesh.bounds.extents * 1000,
max = mesh.bounds.max * 1000,
min = mesh.bounds.min * 1000,
size = mesh.bounds.size * 1000
};
it's still not working .
Is also try this code: still not working...
void OnPreCull()
{
cam.cullingMatrix = Matrix4x4.Ortho(-99999, 99999, -99999, 99999, 0.001f, 99999) *
Matrix4x4.Translate(Vector3.forward * -99999 / 2f) *
cam.worldToCameraMatrix;
}
void OnDisable()
{
cam.ResetCullingMatrix();
}