descriptionnone
repository URLhttps://github.com/vrmiguel/lasercrab.git
ownervrmiguel99@gmail.com
last changeThu, 24 Dec 2020 20:17:22 +0000 (24 17:17 -0300)
last refreshSat, 27 Apr 2024 12:26:43 +0000 (27 14:26 +0200)
content tags
add:
README.md

lasercrab (WIP!)

Lasercrab is a KISS implementation of an al-Haytham's model based ray-tracer, written in Rust.

Lasercrab example Click on the image above to watch a small 4K60 animation made with Lasercrab. Hosted on YouTube.

Building

Lasercrab has no dependencies by default, but Rayon is available as an optional dependency, which can parallelize the rendering of frames. It was developed on rustc 1.47.0, but probably also builds on much older rustc versions.

Building without Rayon

cargo run --release

Building with Rayon

cargo run --release --features parallel

Warning: by default, this will render 600 frames at 1080p, where each one takes 5.9MiB of space.

Usage

As it stands, Lasercrab works on a suckless-like manner.

Spheres, lights and materials are all defined in main.rs, alongside other configurations such as the output's image width and height. Colors, such as the ones used on the checkerboard or the background, may be changed altering the const Vec3fs in shapes.rs.

ffmpeg is a good companion to Lasercrab when making animations, with an example usage being:

ffmpeg -framerate 60 -i output_%d.ppm -c:v libx264 -pix_fmt yuv420p output_anim.mp4

TODO

Things I want to implement in the future.

shortlog
2020-12-24 Vinícius Rodrigues... Better commentsmain
2020-11-21 Vinícius Rodrigues... WIP rotate_camera feature
2020-11-15 Vinícius Rodrigues... Make the floor reflexive
2020-11-15 Vinícius Rodrigues... Minor changes
2020-11-14 Vinícius Rodrigues... New example animation, update the README
2020-11-14 Vinícius Rodrigues... Add optional parallel computing feature
2020-11-13 Vinícius Rodrigues... Drop Nalgebra dependency
2020-11-13 Vinícius Rodrigues... Merge remote-tracking branch 'origin/main' into main
2020-11-13 Vinícius Rodrigues... Minor performance upgrades
2020-11-13 Vinícius MiguelUse a more high-res image as an example
2020-11-13 Vinícius Rodrigues... Add an example image to the README
2020-11-13 Vinícius Rodrigues... Draw a checkerboard on the floor
2020-11-13 Vinícius Rodrigues... First commit
2020-11-13 Vinícius MiguelInitial commit
heads
3 years ago main