- Home /
How to determine what points on terrain can be seen from a certain point?
Hi guys thanks in advance for any help you can provide. I have a scene with an uneven, sloped terrain. I want to place an object/firstperson at the bottom on the slope and be able to get a visual representation of the areas of terrain that are visible from this point, Maybe highlight these areas in one color and hidden area due to slope in another. Any Ideas?
Thanks, James.
Answer by Owen-Reynolds · Jan 31, 2013 at 11:53 PM
That's exactly what a shadowmap does. Set the "sun" at the player's eyes and create the shadowmap based on that. But, have never used one in Unity. In theory, you can change "in shadow = draw darker" to "not in shadow = blue tint."
If the ground is divided into squares, say. Could raycast from the player to every square. If you don't move a lot (like a turn-based game,) then doing that for a few hundred squares shouldn't be a problem.
Your answer
Follow this Question
Related Questions
Make an instantiated object match the slope of the terrain 1 Answer
Making a particle effect parallel to the slope of a terrain 1 Answer
Align plane to normal but keep Y-axis intact 1 Answer
Make the terrain ignore Raycast if in between Camera and Player? 1 Answer
How can I separate tree colliders from terrain colliders? 2 Answers