mmx Posted April 27, 2017 Hi guys! I'm learning OpenGL 3 and i'm looking for some tutorials or examples on how to render Doom maps. I'm trying to create a very simple level viewer to learn more about graphics programming and i wanted something simple and easy. I'm starting with Doom and then Q1 BSP. :) 0 Share this post Link to post
grommile Posted April 28, 2017 If you want examples of how to render Doom levels in OpenGL, look at the source code for GZDoom or PrBoom+ :) 0 Share this post Link to post
Graf Zahl Posted April 28, 2017 And be warned: It's not pretty due to all the special cases that need to be handled. 1 Share this post Link to post
Gez Posted April 28, 2017 This depends largely on how close to the in-game render you want to get. For a level viewer, the simplest approach might be to just turn the map geometry into a single mesh and then render that. If you want to handle, say, the original game's light level, it's going to be a lot more complex. If you want to make an interactive map viewer where you can open doors and ride up and down elevators, you'll have to start adding game logic and handle the deformation of the geometry. If you want to handle maps that exploit some rendering tricks to have features that were normally not available (such as the deep water pool in Final Doom/TNT MAP02) then you'll start having to care about the special cases. If you want to handle port features like translucency, colored lighting, 3D floors, slopes, etc. that's going to be even more stuff to handle. But for something simple that doesn't try to render everything faithfully like the game, just look at the shape of the levels, I'd suggest just writing a renderer for an obj mesh and integrating the map-to-obj conversion code from GZDoom Builder. 0 Share this post Link to post
mmx Posted April 28, 2017 I decided not to read the source from ports like GZDoom in order to avoid those special cases. Those engines have a legacy of supporting different formats, different games and etc. I've wanted to create something clean, supporting only Doom 1 maps. I've found a very nice Rust-based implementation and i'm using that as a reference: https://github.com/cristicbz/rust-doom/blob/master/src/wad/level.rs 0 Share this post Link to post
kb1 Posted April 29, 2017 Good luck. I'd love to see your program once you've got it working! 0 Share this post Link to post