Is there a cheap way to check if a location is visible/occluded?
I'm wondering if there's a computationally cheap way to find out if a point (or better: volume) within the camera's frustum is visible to the player or occluded by an obstacle. I am aware that actors track the last time they've been rendered, so if an actor were already there I could use this, but I'd like to determine where I can spawn actors without the player seeing them pop out of thin air, so I need the information for an empty volume...
Thanks in advance, Andreas
asked Sep 21 '16 at 08:28 AM in C++ Programming
I suppose you could use traces. Suppose you have a bounding volume (a rectangle for simplicity), you could trace from each of its corners to the camera location and if all of the traces hit something it's safe to assume the box is occluded from the camera's view.
See documentation on traces:
Follow this question
Once you sign in you will be able to subscribe for any updates here