Giter VIP home page Giter VIP logo

tinyraytracer_rs's Introduction

tinyraytracer_rs

This repo consists of a Rust implementation of the tinyraytracer walkthrough by professor Dmitry V. Sokolov. For a tinyrenderer Rust implementation, check the tinyrenderer_rs repo.

Dependencies:

  • image 0.24.5: Image loading and manipulation
  • piston_window 1.127.0: Window to display rendered frames
  • obj-rs 0.6: To retrieve information from .obj files
  • nalgebra 0.31.4: For vector and matrix calculations

Usage

To run, just clone any of the branches and execute cargo run --release. If the branch requires some assets, execute:

cargo run --release <assets directory>

where <assets directory> is the directory in which the corresponding assets (like the env map or obj model) are. For example, to run Step 10a you must clone the branch and execute:

cargo run --release assets/

At the moment, if you want to use other assets, you would have to modify the respective assets names in main.

Steps

Step 1: Display image on window

Write to an image buffer and render it in a window.

Branch: Step_1

Preview: Step 1 image

Step 2: Ray tracing

Basic ray tracing for single sphere.

Branch: Step_2

Preview: Step 2 image

Step 3: Add more spheres

Add more spheres. Add basic materials support.

Branch: Step_3

Preview: Step 3 image

Step 4: Diffuse lighting

Add diffuse lighting to scene objects.

Branch: Step_4

Preview: Step 4 image

Step 5: Specular lighting

Add specular lighting to scene objects.

Branch: Step_5

Preview: Step 5 image

Step 6: Shadows

Add shadows computation to scene objects.

Branch: Step_6

Preview: Step 6 image

Step 7: Reflections

Add reflections computation to scene objects.

Branch: Step_7

Preview: Step 7 image

Step 8: Reflections

Add refractions computation to scene objects.

Branch: Step_8

Preview: Step 8 image

Step 9: Rectangle objects

Add finite and infinite plane primitives support.

Branch: Step_9

Preview: Step 9 image

Step 10a: Environment mapping

Add environment mapping support.

Branch: Step_10a

Preview: Step 10a image

Step 10b: Obj models support

Add support for triangle primitives. Use that to render .obj models.

Branch: Step_10b

Preview: Step 10b image

tinyraytracer_rs's People

Contributors

ema2159 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.