- Home /
Camera Frustrum Calculation
Does unity have any built in functions that help calculate the bounds of the camera? I want to place a transparent shader over top of it to show from a 3rd person perspective, everything that is in that cameras field of view.
In scene view, the fustrum is shown already. So unity somewhere is already calculating it.
Answer by aldonaletto · Jul 12, 2011 at 07:40 PM
The frustum is a basic item in any game engine. Unity have a function to calculate the frustum planes for a given camera, CalculateFrustumPlanes and another, TestPlanesAABB which together can be used to check if some object is inside the frustum. But there is an easier feature already included, Renderer.isVisible, which tells if an object is in the frustum of any camera. If you have only one camera, this will be easier to use - but if you plan to use an auxiliary camera to render only what the main camera sees, it will not work because both frustum will be taken into account.
CalculateFrustumPlanes seems to be what Im looking for, I simple want to take the planes it returns and turn them into mesh planes with a transparent shader. Thanks
Your answer
Follow this Question
Related Questions
More questions on generating camera frustrum 1 Answer
How to cut a camera view in half 1 Answer
Mathf.SmoothDamp happens instantly 1 Answer
How to animate zooming in of the camera? 4 Answers