Rust Doom

Rust Doom is a Doom 1 & 2 renderer implemented in Rust. Initially created as a learning project, this renderer offers a fresh take on the classic Doom games with an emphasis on idiomatic Rust code and modern OpenGL rendering techniques.

Key Features

Modern OpenGL Renderer

Rust Doom utilizes a modern OpenGL 3+ renderer, eschewing immediate mode in favor of VBOs (Vertex Buffer Objects) and shaders. This approach ensures more efficient rendering and takes advantage of contemporary graphics hardware capabilities. Notably, the floors are rendered as convex polygons computed from the BSP (Binary Space Partitioning), which eliminates certain visual glitches found in other ports.

Authentic 256 Color Palette

The renderer faithfully replicates the original game's lighting effects using the original palette and colormaps. This involves performing 256 color palette lookups in a fragment shader, a technique that preserves the classic visual style of Doom.

Free Flying Camera

Rust Doom features a free-flying camera controlled via mouse and keyboard, providing full six degrees of freedom. This allows players to explore the game world in a way not possible in the original games.

Safe Rust Code

A key design goal of Rust Doom is to maintain 100% safe code, with no unsafe blocks. This ensures that the renderer adheres to Rust's safety guarantees, minimizing the risk of bugs and undefined behavior.

Build Instructions

Rust Doom is designed to build with the latest stable version of Rust. The build process is straightforward:

  1. Install Rust using one of the methods described on the Rust website.
  2. Clone the repository and navigate to its root directory (where Cargo.toml is located).
  3. Build the project using Cargo:
    cargo build --release
  4. Copy a WAD file to the repository root. You can use a shareware WAD or one from an owned copy of the game.
  5. Run the renderer with the following command:
    target/release/rs_doom --iwad your_wad_file.wad

You can customize the gameplay experience by specifying the level, FOV, and resolution preferences using command-line flags. Run the program with the -h flag to see all available options.

Goals and Progress

Rust Doom has a clear set of goals aimed at enhancing the Doom experience with modern technologies:

  • BSP to convex subsector conversion: Completed
  • Texture mapping for floors, ceilings, and walls: Completed
  • Wall texture alignment and animated textures: Completed
  • Lighting effects and sky rendering: Completed
  • Sprite rendering and player movement: Completed
  • Player-flat and player-wall collisions: Completed
  • Sprite collisions and animations: In progress
  • BSP frustum culling: Planned

These features ensure that Rust Doom not only replicates the original game's look and feel but also enhances it with modern graphics techniques and controls.

Community and Contributions

Rust Doom is an open-source project, and contributions are welcome. The codebase is available on GitHub, and contributors are encouraged to submit pull requests. The project aims to be a valuable resource for those learning Rust and graphics programming.

Rust Doom is a fascinating project that blends nostalgia with modern technology. By reimagining Doom in Rust, it offers a unique perspective on game development and showcases the power and safety of the Rust programming language.

Similar Projects

Rustfinity.com

Links

  1. Home
  2. Learn Rust
  3. Get Started
  4. Practice Rust
  5. Challenges
  6. Tutorials
  7. Blog
  8. Open source
  9. Learn Gleam

Socials

  1. GitHub
  2. X

Legal

  1. Privacy Policy
  2. Terms of Service