1
\$\begingroup\$

Strategy games (such as Door Kickers) use a player's unit's line-of-sight as a major game feature. To provide feedback to the player regarding which areas are in view and which are not, different colours are used to display areas that are currently visible by a unit and areas which are not. Can anyone recommend an approach for creating this effect in a shader?

\$\endgroup\$
4
  • \$\begingroup\$ They're just changing the colour somehow based on line-of-sight. The hard part is calculating line-of-sight. \$\endgroup\$ – user253751 Dec 23 '20 at 20:40
  • \$\begingroup\$ @user253751 Yes.... \$\endgroup\$ – DrMcCleod Dec 23 '20 at 21:00
  • 2
    \$\begingroup\$ There are lots of tutorials online and past Q&A here about implementing this "visibility polygon" effect. How have you tried to implement it based on the research you've done so far? Have you run into a specific obstacle applying these existing answers that we can help you with? \$\endgroup\$ – DMGregory Dec 23 '20 at 23:42
  • \$\begingroup\$ @DMGregory Thanks, it looks like the term 'visibility polygon' is the appropriate lingo. Those links should get me started. \$\endgroup\$ – DrMcCleod Dec 24 '20 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.