- Home /
Determine if a camera is rendering a shadow map
Hi,
I want to do some pre-processing for visible objects.
Therefore I override OnWillRenderObject
. Inside, using Camera.current
, I get the current camera that is going to render the object. Now I wonder if there is a 100% safe way to find out if that camera is a "real" camera or just one for rendering a shadow map. This is important for me because my pre-processing only applies to really visually visible objects and not those that only cast a shadow into the scene but can't actually be seen.
So, is there a way to find out if a camera is rendering a shadow map?
Answer by TomasRiker · Jun 23, 2012 at 07:17 AM
I answer the question myself and hope that it's useful to others with the same problem:
One way to do it is to keep track of all "normal" cameras in a list or set. Then simply check if the current camera is in this list or not. If it's not, it is a camera not created by yourself and depending on the concrete scenario most likely one for shadow map rendering.
Your answer
Follow this Question
Related Questions
How to make camera position relative to a specific target. 1 Answer
Understanding Gun Scopes & Fov 1 Answer
Shadows from culled objects 0 Answers
Multiple post processing profiles? 2 Answers
RTS Camera Rotation and Movement 0 Answers