Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to create an FoV implementation and I was wondering which algorithm is faster - raycasting or shadowcasting?

share|improve this question
I'm a game industry veteran. What's a FoV implementation? What is shadowcasting? Never heard of either. – bmcnett Apr 13 '11 at 3:29
Do you mean inside a roguelike? – Tetrad Apr 13 '11 at 5:14
How about precomputing visibilty with BSP like the good old Quake did? Afterwards you just need to iterate your ray-/shadow-casting over all visible leafs. – LumpN Apr 13 '11 at 8:45
Is it a 2D or 3D world? Is it grid-aligned? Are there many different types of walls? – sam hocevar Apr 13 '11 at 13:04
Sorry about the delay, I'd posted just before an major interruption and was unable to get back to you all right away. @bmcnett, an FoV implementation is a field of view implementation. There's all sorts of information on the web if you Google it. @Tetrad yes. @LumpN how would I go about that? @Sam Hocevar it's a 2D word, grid aligned, one type of wall. – Elliot Bonneville Apr 14 '11 at 1:12

Raycasting and shadow casting are types of algorithms, not algorithms themselves (in this context). So neither have any performance characteristics, per se, and thus neither one is faster than the other.

"Shadow casting" as a FOV technique isn't very common, I've only ever seen the term used widely in Roguelike development circles (and in fact the RogueBasin has a number of articles on shadow casting FOV techniques, such as the spiral path implementation and plenty of articles on FOV in general).

You also might find this article from GDNet interesting.

It's important to remember that there are more factors to consider than just performance -- while shadowcasting techniques tend to be faster than their raycasting counterparts, you pay a trade off in the shape of the results. Some algorithms generate more anomalies and artifacts than others, some procedures don't produce exactly uniform or symmetric results.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.