1
0
Fork
You've already forked rust-doom
0
A Doom Renderer written in Rust.
  • Rust 96.2%
  • Python 2.3%
  • GLSL 1.5%
Find a file
Cristi Cobzarenco 6aa7681cee
Merge pull request #146 from cristicbz/rust2021
update to rust 2021
2021年10月25日 18:45:19 +01:00
.github Create FUNDING.yml 2019年06月09日 21:59:00 +01:00
assets meta: fix non-lift platforms 2017年10月22日 23:10:16 +01:00
engine Fix some clippy warnings 2021年06月15日 01:48:44 -04:00
engine_derive upgrade to newest deps 2021年04月02日 21:03:47 +01:00
game Fix some clippy warnings 2021年06月15日 01:48:44 -04:00
math upgrade to newest deps 2021年04月02日 21:03:47 +01:00
scripts meta: fix non-lift platforms 2017年10月22日 23:10:16 +01:00
src upgrade to newest deps 2021年04月02日 21:03:47 +01:00
wad update to rust 2021 2021年10月25日 18:44:33 +01:00
.gitignore glium feature parity 2015年10月25日 12:10:57 +00:00
.travis.yml engine: replace sdl2 with glutin 2017年11月04日 15:20:00 +00:00
Cargo.lock upgrade to newest deps 2021年04月02日 21:03:47 +01:00
Cargo.toml update to rust 2021 2021年10月25日 18:44:33 +01:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2017年12月26日 12:27:48 +02:00
LICENSE Update LICENSE 2017年11月02日 21:46:58 +00:00
README.md Update README.md 2021年04月01日 19:59:34 +01:00
rustfmt.toml rustfmt fallout 2015年11月01日 00:21:34 +00:00

Build Status

Rust Doom

A little Doom 1 & 2 Renderer written in Rust. Mostly written while I was learning the language starting around 6 years ago, so it might not the best example of Rust code! PR-s are welcome.

The code is mostly based on the endlessly useful Doom Wiki and the Unofficial Doom Specs. It is not a port of the original Doom C source code into Rust; I've been doing my best to make the code as idiomatic as possible and have not looked at the original in a long time.

Note: You need a WAD file to try this. Get a shareware one if you don't own the game.

Screenshots

Zig-zag Screenshot Doom 2 Screenshot

Build Instructions

Rust Doom should always build on the latest stable version of Rust (but is also tested on beta and nightly), which you can install using any of the methods described on the Rust website.

To build, run cargo in the project's root (where Cargo.toml is):

cargo build --release

Note that you'll need a WAD file (which contains the game's levels and art assets). If you own the game (or are willing to buy it for a few quid/bucks), you'll find the WAD in your game folder. If not, you can use the shareware ones floating around on the interwebs. Or, though I would not know of such things, you may be able to obtain the originals for free in less.... savoury parts of the internet.

Copy the WAD file to the repo root (where Cargo.toml is). Then, to run:

target/release/rs_doom --iwad your_wad_file.wad

Without any flags it will try to load the first level of 'doom1.wad'. You can specify which level to load, FOV and resolution preferences using the flags. Run with '-h' for a list of options.

Goals

(subject to change)

  • Modern OpenGL 3+ renderer. No immediate mode shenanigans: it's all VBO-s and shaders. Unlike some GL ports, the floors are actually rendered as convex polygons computed from the BSP. The downside of this (or upside depending on your perspective) is that some visual glitches (like slime trails) don't show up.
  • Correct 256 color palette. Uses the original palette and colormaps to replicate the original lighting effects (mostly you'll notice things get darker in visible steps and they also get greyer as they get darker). Doing 256 color palette lookups in a fragment shader is wonderfully anachronistic.
  • Free flying camera. Mouse & keyboard control for full 6 degrees of freedom.
  • 100% safe code. No pesky unsafe blocks anywhere.

Todo

  • BSP -> convex subsector conversion.
  • Flats (floors & ceiling) texture mapping.
  • Wall texture mapping.
  • Wall texture alignment.
  • Scrolling walls.
  • Animated flats.
  • Animated walls.
  • Lighting effects (flickering, flashing, glow etc.)
  • Sky rendering.
  • Sprite rendering.
  • Correct player movement (falling etc.)
  • Player-flat collisions.
  • Player-wall collisions.
  • Sprite-player and sprite-sprite collisions.
  • Sprite animations.
  • BSP frustum culling.