GitHunt
PE

PetarKirov/Chess2RT

A raytracer written in D.

Chess2RT GitHub Actions Status

A raytracer renderer, written in D, which will eventually be used for a
3d rendered chess game (and/or a variation of it).

chess2rt_screenshot_20_sept_2016
( Cubemap skybox courtesy of: http://www.custommapmakers.org/skyboxes.php )

What works

  • Simple geometry objects: spheres, cubes and a horizontal plane.
  • CSG combinations of supported geometry objects (including CSG objects).
  • Procedural textures.
  • Lambert and Phong shading.
  • Loading scenes from .sdl or .json files. You can find sample scene files in data/.
  • Interactive camera movement (, , , for movement, Shift + ←, Shift + ↓, Shift + →, Shift + ↓ for mouse look, Ctrl + ←, Ctrl + → for rotation and Ctrl + ↑, Ctrl + ↓ for up and down moving).

Performance statistics

Available here.

Build Instructions

  1. Install what's needed (if you haven't yet):

    • D compiler with frontend >= v2.071.1 (e.g. DMD)
    • dub package manager >= v1.0.0
    • SDL 2 binaries >= v2.0.0 (SDL 2.0.3 DLLs are included for windows)
  2. Git clone:

    git clone https://github.com/ZombineDev/Chess2RT.git
    
  3. Run DUB:

    cd ./Chess2RT
    dub
    

Scene files

Scene files are written in SDLang or JSON and are usually put in the data/ folder.
To render a specific scene you can either:

  • call the app from the command-line like this:

    ./Chess2RT/bin/<OS>/chess2rt --file=data/scene1.sdl
    
  • place the path to scene you wish to load in data/default_scene.path and call chess2rt without arguments.

Compatibility

Linux Windows
DMD 64 Build Status Build status
DMD 32 Build Status Build status
LDC 64 Build Status Build status
  • DMD (reference D compiler) >= 2.071.1
  • LDC (LLVM D Compiler) >= 1.1.0-beta2.

Acknowledgement

I developed this project for the 3D Graphics and Raytracing course at fmi.uni-sofia.
Most of the code in ./source/rt/ is based on https://github.com/anrieff/trinity/.

This project uses:

Languages

D99.5%Nix0.5%

Contributors

Created August 12, 2014
Updated October 23, 2024