Alright guys, Here’s the actual thread for KDoom, so all feedback for it should go there.
uhhh… noo…
Opengl doesn’t do anything with rays. Opengl projects primitives into 2d space and uses perspective correct texture mapping. Lighting is an approximation based on distance and angle, and shadows are a whole other hack.
If OpenGL would be a RayTracer we could have:
- Built in infinite Resolution for Curved Surfaces
- Built in Realtime Reflections (Mirror)
- Built in Realtime Refractions (Glass)
- Built in Realtime Ray Scene Traversal (Portal)
- etc. etc.
OpenGL is a library that takes primitives and draws them onto the screen using matrix projections, as deepthought said.
Have a nice day.
- Longor1996
Its not a stupid reason at all, it is something different and well worth it to figure out how it worked; at the very least it is entertaining to do and get a prototype working, especially nowadays where you can just create a dumb, unoptimized and more readable version that does not need assembly to get it to perform well enough. I like to revisit the classic techniques myself and wonder how they did it back in the day.
I’m fairly sure The Cherno’s code is very similar to Notch’s Prelude of the Chambered (http://s3.amazonaws.com/ld48/index.html), and it doesn’t actually do any raycasting at all It’s all just perspective texture projection.
Thank you for that
And yes, I know The Cherno used Notch’s code. He never gave any credit, sadly.