Hacker News new | past | comments | ask | show | jobs | submit login

Doom doesn't use raycasting, it uses binary space partitioning.

From the description it seems to be a DOOM clone. Physics feels a bit off, but all the little details may trick you into believing that it's the real thing.




Doom uses both: binary space partitioning to find the visible surfaces then casting rays to draw the textures.


There is no need to cast rays when you have divided the space into convex polygons. If you know all the vertices of a convex polygon and two of them form a visible wall, you can determine the texture column and height of the screen space wall column by means of interpolation. This is what the Doom engine does.

The PC version of Wolfenstein 3D used a more straight forward ray casting approach, but I think the SNES port was Id's first use of BSP.


It doesn't. Doom uses BSP to precisely determine which columns of textures it needs to render.

It's faster than raycasting, so this was even used in Wolf3D port to GBA.


Yeah is fast and cheap because the BSP tree is created after the level mapped out. It's also why "Will it run DOOM?!" is a thing.

For further reading: https://en.wikipedia.org/wiki/Doom_engine#Binary_space_parti... https://en.wikipedia.org/wiki/Binary_space_partitioning#Appl...




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: