{"id":16661689,"url":"https://github.com/ennocramer/lucifer","last_synced_at":"2025-07-16T12:37:37.688Z","repository":{"id":95102326,"uuid":"116800694","full_name":"ennocramer/lucifer","owner":"ennocramer","description":"Lucifer is a physically based renderer, written as a tutorial on how  to implement raytracing and pathtracing in Rust.","archived":false,"fork":false,"pushed_at":"2018-10-01T12:45:50.000Z","size":333,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T14:24:18.439Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ennocramer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-09T10:20:52.000Z","updated_at":"2024-07-19T23:50:05.000Z","dependencies_parsed_at":"2023-03-08T22:00:53.452Z","dependency_job_id":null,"html_url":"https://github.com/ennocramer/lucifer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennocramer%2Flucifer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennocramer%2Flucifer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennocramer%2Flucifer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ennocramer%2Flucifer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ennocramer","download_url":"https://codeload.github.com/ennocramer/lucifer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243298000,"owners_count":20268889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T10:35:50.454Z","updated_at":"2025-03-12T21:29:44.632Z","avatar_url":"https://github.com/ennocramer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lucifer\n\nLucifer is a physically based renderer, written as a tutorial on how\nto implement raytracing and pathtracing in Rust.\n\n![example](example.png)\n\nLucifer tries to showcase a very clean and easy-to-understand\nimplementation of the basics of 3D rendering using raytracing.\n\nThe first few [commits](https://github.com/ennocramer/lucifer) are\nstructured as a tutorial, showing the implementation of the core\nstructures and algorithms of a [path\ntracing](https://en.wikipedia.org/wiki/Path_tracing) renderer.\n\n## Building\n\nLucifer is written in [Rust](https://www.rust-lang.org/) and may,\ndepending on when you're trying to build it, require on the nightly\nrelease of the Rust compiler.\n\n``` sh\n# Install Rust via Rustup\n$ curl https://sh.rustup.rs -sSf | sh\n\n# Install nightly release, if necessary\n$ rustup install nightly\n$ rustup default nightly\n\n# Build lucifer\n$ cargo build --release\n\n# Run lucifer to generate the example output\n$ cargo run --release example.png\n```\n\n## Core Concepts\n\n### Space\n\nSpace is represented using the `Vector` and `Point` types, taken from\nthe [cgmath crate](https://crates.io/crates/cgmath).  `Point`\nrepresents positions in space, while `Vector` represents directions\nand distances between points.\n\nA `Ray` is a straight line through space.  It has an origin, a\ndirection, and a possibly infinite length.  Rays represent the path\nphotons travel unhindered after being emitted, until interacting\n(possibly being absorbed or reflected) with the surface of an object.\n\nAn `Intersection` describes a location where a photon hits, and\ninteracts with, an object. It consists of the point in space where the\nintersection occurred, the object's surface's normal vector, the\ndistance from the photon's origin, and a boolean indicating whether\nthe surface was hit from the object's inside or outside.\n\nA `Geometry` is the abstraction of a physical shape. It provides\nmethods for intersections tests between itself and `Ray`s.\n\n### Energy\n\nLight is represented using the `Radiance` structure, which models the\nradiant intensity of light coming from a given direction. Radiant\nintensity defines the color and brightness of light.\n\nThe color of a surface is represented by `Albedo`.  An `Albedo` is a\nmultiplicative factor for `Radiance`, with the assumption that any\nvalue is between zero and one.  I.e. an `Albedo` cannot increase\n`Radiance` and cannot turn `Radiance` negative.\n\nThe appearance of a surface is modeled as a set of `Effect`s, each\nrepresenting a specific type of interaction between light and the\nsurface.  The set of `Effect`s is called `Bsdf`.\n\nEach effect is composed of an effect type, a `Distribution`, and some\ncombination of `Radiance`, `Albedo`, and `Ior`.  There are five\ndifferent effects:\n\n  1. **Emission** is light emitted by a surface, independently of\n     incoming light. This is the primary `Effect` for light sources.\n\n     Emission is defined by a `Radiance` value and a distribution\n     function.\n\n  2. **Diffuse Reflection** is light scattered by the surface.  This\n     is the primary `Effect` for rough surfaces.\n\n     Diffuse reflection is defined by an `Albedo` value and a\n     distribution function.  The `Distribution` is centered on the\n     surface normal\n\n  3. **Specular Reflection** is light reflected by the surface.  This\n     is the primary `Effect` for shiny surfaces and mirrors.\n\n     Specular reflection is defined by an `Albedo` value and a\n     distribution function.  The `Distribution` is centered on the\n     reflected incidence direction.\n\n  4. **Diffuse Refraction** is light transmitted, but scattered by the\n     surface. This is the primary `Effect` for light-transmitting, but\n     non-transparent objects.\n\n     Diffuse refraction is defined by an `Albedo` value and a\n     distribution function. The `Distribution` is centered on the\n     mirrored surface normal.\n\n  5. **Specular Refraction** is light transmitted and refracted by the\n     surface. This is the primary `Effect` for clear, transparent\n     objects.\n\n     Specular refraction can turn into reflection, if the angle of\n     incidence is low.\n\n     Specular refraction is defined by an `Albedo` and `Ior` value and\n     a distribution function.  The `Distribution` is centered on the\n     refracted incidence direction.\n\nThe `Material` trait is responsible to compute the surface's\nappearance at the point of intersection.  The generated set of\n`Effect`s and their attributes can vary depending on the attributes of\nthe `Intersection`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fennocramer%2Flucifer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fennocramer%2Flucifer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fennocramer%2Flucifer/lists"}