omegga-raytracer-cr

Raytracer for Omegga, in Crystal

omegga-raytracer-cr

Sample render

This Omegga plugin acts as a basic raytracer. It allows you to capture small scenes in your Brickadia server and render them out to bricks or an image.

This project started in JavaScript, featuring raytracing features like shadows, reflections, and basic diffuse lighting. Since, I have reimplemented the entire raytracer in Crystal and added more features like refractions, lighting, Blinn-Phong shading, meshes, materials, textures, skyboxes, and more. The above screenshot is a sample raw output from the raytracer demonstrating some of these features.

Practicality

This raytracer is highly experimental, and I would not suggest it for real use. It is feasible to render small scenes of less than 1,000 bricks with a few lights, but it is highly unoptimized and does exactly what you tell it to. Be careful rendering massive scenes.

Installation

First, install Crystal. Then,

omegga install gh:voximity/raytracer-cr

Multithreading

To enable multithreading, you can edit your omegga_plugin to be the following:

#!/bin/bash
cd plugins/omegga-raytracer-cr
shards build -q -Dpreview_mt && CRYSTAL_WORKERS=N ./bin/omegga-raytracer-cr

where N is the amount of workers (cores/threads) you'd like to allocate to the raytracer.

Usage

TODO: this

Contributing

  1. Fork it (https://github.com/voximity/omegga-raytracer-cr/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

omegga-raytracer-cr

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 3
  • over 3 years ago
  • May 19, 2021
License

MIT License

Links
Synced at

Fri, 08 Nov 2024 00:38:34 GMT

Languages