How to create 2D visibility/shadow effects for your game
ncase.github.io
How to create 2D visibility/shadow effects for your game
1–10 of 47 posts
Re: How to create 2D visibility/shadow effects for your game
#21) a tutorial on the same topic by Red Blob Games: http://www.redblobgames.com/articles/visibility/
2) a public domain Javascript visibility polygon library that runs in O(n log n), which is actually used in the Nothing to Hide game: https://code.google.com/p/visibility-polygon-js/
3) a blog post by author of said library discussing the algorithm: http://byronknoll.blogspot.ca/2013/05/on-log-n.html
Shooting a ray to every vertex and then naively computing intersections takes O(n^2) since there are n rays with up to O(n) intersections each. It is interesting to read and think about O(n log n) algorithms for computing the visibility polygon.
Re: How to create 2D visibility/shadow effects for your game
#3(Note: I have no connection to this developer. Just thought it was worth mentioning.)
Re: How to create 2D visibility/shadow effects for your game
#4Re: How to create 2D visibility/shadow effects for your game
#5Re: How to create 2D visibility/shadow effects for your game
#6He uses a nice trick to approximate the real thing, however this algorithm wouldn't be able to deal with curved objects.
Re: How to create 2D visibility/shadow effects for your game
#7He uses a nice trick to approximate the real thing, however this algorithm wouldn't be able to deal with curved objects.
This is a nice little post that reasonably describes a technique that has been used by a fair number of professional, commercial products. That anyone would try to downplay it to make themselves feel superior is silly.
To provide some actual value, most of the the images in the post are actually interactive. It's pretty cool. I somehow read the whole thing and didn't notice.
Re: How to create 2D visibility/shadow effects for your game
#8He uses a nice trick to approximate the real thing, however this algorithm wouldn't be able to deal with curved objects.
I'm downvoting your comment because on technical posts the top rated comment is damn near always of zero value and only serves to make the commenter try to sound smarter than the post author. The more in-depth and complicated the post the more those type of comments appear. This is a nice little post that reasonably describes a technique that has been used by a fair number of professional, commercial products. That a…
"Today, I will show you how to make something like this: (move your mouse around in the box below)"
"The demo below just draws a bunch of line segments and tracks your mouse position."
"Here's what all that math looks like: (move your mouse over the box)"
Re: How to create 2D visibility/shadow effects for your game
#9Related: 1) a tutorial on the same topic by Red Blob Games: http://www.redblobgames.com/articles/visibility/ 2) a public domain Javascript visibility polygon library that runs in O(n log n), which is actually used in the Nothing to Hide game: https://code.google.com/p/visibility-polygon-js/ 3) a blog post by author of said library discussing the algorithm: http://byronknoll.blogspot.ca/2013/05/on-log-n.html Shooting…