Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
mmx

Rendering Doom maps in OpenGL 3

Recommended Posts

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. :)

Share this post


Link to post

If you want examples of how to render Doom levels in OpenGL, look at the source code for GZDoom or PrBoom+ :)

Share this post


Link to post

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.

Share this post


Link to post

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

Share this post


Link to post

Good luck. I'd love to see your program once you've got it working!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×