All Projects → alesgenova → ray-tracer

alesgenova / ray-tracer

Licence: other
A simple ray tracing engine

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to ray-tracer

LumillyRender
Monte Carlo path tracing implementation on Rust
Stars: ✭ 36 (+33.33%)
Mutual labels:  raytracing, pathtracing, ray-tracing, path-tracing
webrays
WebRays - Ray Tracing on the Web
Stars: ✭ 38 (+40.74%)
Mutual labels:  raytracing, ray-tracing, path-tracing
fluctus
An interactive OpenCL wavefront path tracer
Stars: ✭ 55 (+103.7%)
Mutual labels:  raytracing, pathtracing, path-tracing
nerv pathtracer
a pathtracer with physically based rendering in mind
Stars: ✭ 27 (+0%)
Mutual labels:  raytracing, pathtracing, path-tracing
Awesome Ray Tracing
Curated list of ray tracing resources
Stars: ✭ 414 (+1433.33%)
Mutual labels:  raytracing, ray-tracing
Raytracing.github.io
Main Web Site (Online Books)
Stars: ✭ 4,485 (+16511.11%)
Mutual labels:  raytracing, ray-tracing
Voxel Cone Tracing
A real-time global illumination implementation using voxel cone tracing. Implemented in C++ and GLSL.
Stars: ✭ 555 (+1955.56%)
Mutual labels:  raytracing, ray-tracing
50yearsofraytracing
以历史的发展的眼光来看光线追踪技术,1968年至2018年重点论文相关算法复现。
Stars: ✭ 90 (+233.33%)
Mutual labels:  raytracing, ray-tracing
Luxcore
LuxCore source repository
Stars: ✭ 601 (+2125.93%)
Mutual labels:  raytracing, ray-tracing
Diligentengine
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+7833.33%)
Mutual labels:  raytracing, ray-tracing
Rayt
Monte Carlo ray tracer developed using Rust
Stars: ✭ 185 (+585.19%)
Mutual labels:  raytracing, ray-tracing
Plotoptix
Data visualisation in Python based on OptiX 7.2 ray tracing framework.
Stars: ✭ 252 (+833.33%)
Mutual labels:  raytracing, ray-tracing
C Ray
C-Ray is a small, simple path tracer written in C
Stars: ✭ 323 (+1096.3%)
Mutual labels:  raytracing, ray-tracing
Diligentcore
Core functionality of Diligent Engine
Stars: ✭ 263 (+874.07%)
Mutual labels:  raytracing, ray-tracing
Sort
Simple Open-source Ray Tracer
Stars: ✭ 485 (+1696.3%)
Mutual labels:  raytracing, ray-tracing
CLUSEK-RT
Vulkan based C++ ray-tracing game engine.
Stars: ✭ 24 (-11.11%)
Mutual labels:  raytracing, pathtracing
Monte carlo ray tracer
A program with an implemented Monte Carlo Ray Tracer algorithm for global illumination of a virtual 3D scene.
Stars: ✭ 90 (+233.33%)
Mutual labels:  raytracing, ray-tracing
Unreal-Development-Guides-and-Tips
High-level concept explanations, detailed tutorials, performance considerations, shortcuts and other useful content that aims to improve your Unreal Engine 4 development journey.
Stars: ✭ 118 (+337.04%)
Mutual labels:  raytracing, ray-tracing
OpenTK-PathTracer
C# OpenGL Path Tracer, Real-Time GPU accelerated
Stars: ✭ 22 (-18.52%)
Mutual labels:  raytracing, path-tracing
Unitydxrtest
A testbed project for Unity real-time ray tracing features
Stars: ✭ 172 (+537.04%)
Mutual labels:  raytracing, ray-tracing

Ray Tracer

A toy ray tracer for educational purposes (i.e. my own education).

Demo

demo-img

Features

  • Geometries:
    • Sphere
    • Rectangle
    • Cube
  • Transformations:
    • Translation
    • Rotations (TODO)
    • Scale (TODO)
    • Sheer (TODO)
  • Materials:
    • Lambertian
    • Metal
    • Dielectric
    • Emitting
  • Textures:
    • Uniform
    • Checker
    • Gradient (TODO)
    • Image (TODO)
    • Perlin (TODO)
  • Cameras:
    • Perspective
    • Orthographic (TODO)
  • Ray / Actor hit search
    • Linear
    • Binary Tree
    • Octree

Usage

use ray_tracer::vector::Vec3;
use ray_tracer::scene::Scene;
use ray_tracer::hitable::primitive::Sphere;
use ray_tracer::hitable::primitive::Rectangle;
use ray_tracer::hitable::transform::Translation;
use ray_tracer::camera::perspective::PerspectiveCamera;
use ray_tracer::renderer::Renderer;
use ray_tracer::material::Material;
use ray_tracer::material::plain::PlainMaterial;
use ray_tracer::material::lambertian::LambertianMaterial;
use ray_tracer::material::metal::MetalMaterial;
use ray_tracer::actor::Actor;
use ray_tracer::texture::uniform::UniformTexture;
use ray_tracer::constants::Axis;

let mut scene = Scene::<f64>::new();
scene.set_background(Vec3::from_array([0.2, 0.2, 0.2]));

// The floor
let hitable = Box::new(Rectangle::new(100.0, Axis::X, 100.0, Axis::Y));
let texture = Box::new(UniformTexture::new(Vec3::from_array([0.8, 0.8, 0.8])));
let material = Box::new(LambertianMaterial::new(texture, 0.65));
let actor = Actor { hitable, material};
scene.add_actor(actor);

// A sphere
let hitable = Box::new(Sphere::new(1.5));
let hitable = Box::new(Translation::new(hitable, Vec3::from_array([0.0, 0.0, 1.5])));
let texture = Box::new(UniformTexture::new(Vec3::from_array([1.0, 0.2, 0.2])));
let material = Box::new(MetalMaterial::new(texture, 0.0));
let actor = Actor { hitable, material};
scene.add_actor(actor);

// A light
let hitable = Box::new(Sphere::new(2.5));
let hitable = Box::new(Translation::new(hitable, Vec3::from_array([0.0, -2.0, 12.5])));
let texture = Box::new(UniformTexture::new(Vec3::from_array([1.0, 1.0, 1.0])));
let material = Box::new(PlainMaterial::new(texture));
let actor = Actor { hitable, material};
scene.add_actor(actor);


// Set up the camera
let width = 320;
let height = 180;
let aspect = width as f64 / height as f64;

let mut camera = PerspectiveCamera::<f64>::new();
camera.set_fov(0.37 * std::f64::consts::PI);
camera.set_position(&[0.0, - 4.0, 1.5]);
// camera.set_direction(&[0.0, 1.0, 0.0]);
camera.set_lookat(&[0.0, 0.0, 1.5]);
camera.set_up(&[0.0, 0.0, 1.0]);
camera.set_fov(0.35 * std::f64::consts::PI);

// Set up the renderer
let samples = 256;
let max_reflections = 8;
let antialiasing = false
let renderer = Renderer::new(width, height, samples, max_reflections, antialiasing);

// Process the image
let image = renderer.render(&scene, &camera);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].