- Home /
Question by
MarshCZA · Mar 19, 2018 at 05:00 PM ·
raycasttexture2draycastingrendererocclusion culling
I want to paint the surface of a mesh depending on if it has been seen by a camera, can this be done with shaders?
I want a model to turn green on areas that have been seen by a camera during a certain time. I am currently sending raycasts from every pixel of the camera to the world and changing the texture's pixels as shown in Unity's documentation. The problem is that this is a good 2 million + raycasts and causes 3000ms+ delays.
I'm sure there must be a cheaper way to do this, like how occlusion culling would work. So I am wondering how to access this information, is it possible to do with shaders?
Comment