logoalt Hacker News

krapp • today at 4:00 PM • 1 reply • view on HN

Modern Doom games are real 3D, but the original was using an advanced form of raycasting[0].

[0]https://doomwiki.org/wiki/Doom_rendering_engine


Replies

wk_end • today at 6:49 PM

No it doesn't; that's a common misconception.

Raycasting (in gaming, some graphics folks just use it as another term for raytracing) means to fire a ray for each column of the screen, identify where it collides with a wall, and use that to determine what to render for that column - it's basically per-column raytracing.

DOOM's engine instead uses a BSP tree so that, from any position, you can determine which walls are on-screen instantly just by walking the tree - the nearer walls appear earlier in the traversal than farther walls. It's still column-based (it tracks whether each column has been drawn and won't draw further walls behind an already drawn column, and stops drawing once all columns are filled), but there's no rays cast.