From b44d2155e6a43b2abaf3c5c6d934d97ead72c099 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Wed, 29 Sep 2021 21:23:52 -0400 Subject: Better description --- README.md | 34 ++++++++++++++++++++++++++++------ screenshot.png | Bin 0 -> 42650 bytes src/constants.zig | 4 ++-- 3 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 screenshot.png diff --git a/README.md b/README.md index 09e47cb..9cf4fe5 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,38 @@ # ZiRC -Learning Zig by building a Raycasting engine (of sorts). Work in -progress. +Learning Zig by building a raycasting engine. + +![Screenshot](screenshot.png) + +An explicit goal of this project is to do as much as possible in software. As such, except for the skyclinder, all of the rendering is done in software and hardware acceleration is only used to scale the resulting image. + +In particular alpha blending is implemented in software. This was the result of an interesting diversion into unsigned integer arithmetic approximations of floating point computations. + +## Features + +- [X] Basic textured raycasting +- [X] View-bobbing, collision detection with walls, momentum etc +- [X] Textured floors and ceilings +- [X] Variable height walls +- [X] Render tops of walls +- [X] Static sprite objects +- [X] Skyclinder* +- [X] No overdraw (without sprites, skyclinder) +- [ ] Variable height ceilings +- [ ] Walls extending from ceiling instead of floor +- [ ] Sprites look different from different directions +- [ ] Animated textures + +*It's topologically a cylinder, not a box; hardware rendered for now ## Build -Ensure you have a recent version of Zig (tested on -`0.9.0-dev.866+6a6e2cd64`), and the `csfml` library somewhere we your -linker can find it. Then run +Ensure you have a recent version of Zig (tested on `0.9.0-dev.866+6a6e2cd64`), and the `csfml` library somewhere we your linker can find it. Then run `zig build -Drelease-fast run` +The default keybinds are FRST for Forward, Left Strafe, Backward, Right Strafe and the arrow keys for similar but turn instead of strafe. Escape exits. + ## License -GPLv3+ +the code is GPLv3+, the artwork is CC-BY-SA 4.0 diff --git a/screenshot.png b/screenshot.png new file mode 100644 index 0000000..c5c6444 Binary files /dev/null and b/screenshot.png differ diff --git a/src/constants.zig b/src/constants.zig index 1ca0c4f..d363af5 100644 --- a/src/constants.zig +++ b/src/constants.zig @@ -18,8 +18,8 @@ pub const ScreenWidth: f32 = 1024; pub const ScreenHeight: f32 = 768; -pub const PlaneWidth = 320; -pub const PlaneHeight = 240; +pub const PlaneWidth = 640; +pub const PlaneHeight = 480; pub const HFact = ScreenWidth / PlaneWidth; pub const VFact = ScreenHeight / PlaneHeight; -- cgit v1.3.1