News for hackers. Stuff that matters.
Re:The joy of building a ray tracer, for fun, in Rust by Narishma on Tuesday January 04, 2022 @07:37AM (#29794070)
I might be mistaken but I don't think Doom uses ray casting.
Re:The joy of building a ray tracer, for fun, in Rust by dahart on Tuesday January 04, 2022 @11:23AM (#29796531)
Doom’s predecessor Wolfenstein 3D was famous for using ray casting, and the Doom engine inherited ray casting and extended it to handle different floor heights. https://lodev.org/cgtutor/raycasting.html
Re:The joy of building a ray tracer, for fun, in Rust by Narishma on Tuesday January 04, 2022 @12:30PM (#29797336)
That's Wolfenstein 3d though. It's been a few years since I last checked Doom's source code but I don't remember seeing anything about raycasting in it. And a quick search leads me to things like [1] which seem to confirm it. But then all the replies to my comment seem sure that it used raycasting, so maybe I'm missing something.

1. https://www.doomworld.com/forum/topic/71128-so-is-doom-a-ray...

Re:The joy of building a ray tracer, for fun, in Rust by dahart on Tuesday January 04, 2022 @01:36PM (#29798243)
Maybe you’re right! I could be wrong, I was only repeating what I’ve heard second hand and read in blog posts. Looking at the code right now, there is a ray casting function called P_CheckSight() that is used for collision and enemy tests, but isn’t part of the core rendering algorithm. Carmack did say “I used the BSP tree for rendering things” but also that the basic rendering concept is “horizontal and vertical lines of constant Z”. It seems entirely possible that this engine is a sort of hybrid of the category we think of “ray casting”, that it’s not exactly what someone assumes when hearing that phrase, but also not entirely different either.
Re:The joy of building a ray tracer, for fun, in Rust by boondaburrah on Tuesday January 04, 2022 @07:45AM (#29794126)
I think it did but only in one dimension to determine wall distance and then faked everything else.
Re:The joy of building a ray tracer, for fun, in Rust by russtrotter on Tuesday January 04, 2022 @09:55AM (#29795390)
The early Doom 1 and 2 being software renderers, used ray casting (386 protected mode FTW to boot!) The later versions though, were part of the first wave of games to leverage GPU cards. I don't know if those newer releases still kept any ability to render purely in software though.
Re:The joy of building a ray tracer, for fun, in Rust by Narishma on Tuesday January 04, 2022 @12:31PM (#29797346)