Code Monkey home page Code Monkey logo

rtdoom's Introduction

rtdoom

Implementation of a Doom-style graphics engine in C++ 17

Features

  • from-scratch software-based rendering implementation (no 3D libraries used)
  • following originally used algorithms: BSP tree, occlusion maps instead of z-buffer, no overdraw
  • ability to load original Doom WAD files

Screenshots

Wireframe mode

screenshot

Solid mode

screenshot

Textured mode

screenshot

Step frame mode

screenshot

Goal

While I follow original algorithms which were designed for resource-constrained architectures the primary goal of this project is to provide an easily understandable implementation and performance is not a focus (for example floating-point is used, objects are not reused as much as they could, many values are not precalculated etc.)

Algorithm

See Fabien Sanglard's Game Engine Black Book: DOOM for a walkthrough of algorithms used in the original game, most of which are replicated here.

Code

Test program uses SDL2 to render the raw framebuffer in a screen window, controls are:

  • arrow keys to move around
  • 1/2/3 to switch between render modes (Wireframe/Solid/Textured)
  • m to load the next map in the .wad file
  • s to slow down rendering of the next frame to see individual parts being drawn
  • Escape to exit

Built on Windows / Visual Studio 2017 using C++ 17 profile.

No assets included - you will need to drop off a .wad file from either the original Doom (1 or 2, shareware is ok) or the Freedoom project into the .exe directory!

Bonus - OpenGL Renderer

  • GLRenderer.cpp and GLContext.cpp contain a very basic hardware-accelerated renderer implemented using OpenGL 3.3 core profile, press 4 to switch the view to OpenGL. You will need to supply a V2 .gwa file alongside the .wad containing GL node data, which can be generated using glBSP.

screenshot

rtdoom's People

Contributors

mausimus avatar

Stargazers

Paul Cunningham avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.