Giter Site home page Giter Site logo

tracey's Introduction

Tracey

3d Ray Tracer written in C++ (multithreaded)

Final images

5.8 min, 1080p, glass smoothed bunny

.obj file model rendering

Smoothed stanford bunny (4968 triangles) Not smoothed stanford bunny (4968 triangles)
4.4 min, 1080p, 1x SS 4.4 min, 4k, 1x SS
Smoothed elephant (1143 triangles) Not smoothed elephant (1143 triangles)
1min, 1080p, 1x SS 1min, 1080p, 1x SS

Features:

  • Multithreading
  • Triangle meshes (.obj)
  • Vertex normal interpolation (meshes)
  • Supersampling anti-aliasing
  • Blinn-Phong shading (ambient, diffuse and specular terms)
  • Hard shadows
  • Point lights
  • Depth checking
  • Reflections
  • Refractions

TODO

  • Multithread in chunks
  • Bezier curves
  • Soft shadows
  • Area Lights
  • Glossy reflections
  • Beer's law
  • Texture mapping
  • Png output (png++)
  • Transparent shadows
  • Motion blur
  • Depth of field
  • Speedup structures (kd-trees, etc.)

Geometric primitives:

  • Planes
  • Spheres
  • Triangles
  • Disks (WIP)
  • Boxes (WIP)

Ray tracing introduction (with screenshots)

Ray tracing is a 3d rendering technique that attemps to generate photorealistic images by tracing rays that are shot from every pixel of the image and applying mathematical and physical concepts to accomplish techniques described below.

Ambient Light

The light that gets scattered all around the scene, takes object ambient reflection parameter into consideration.

Diffuse lighting

Diffuse shading applies a shadow on an object by getting the cosine angle of the closest object's normal and light direction, giving the object a matte effect. The lower the angle of the light direction to the object's normal, the brighter that point of the object.

Shadows

To check if a particular point of the image is a part of a shadow, a ray is traced from an intersection point to the light source. If the intersection point to light position ray hits some object along the way, the intersection point is a shadow.

Specular lighting / Blinn-Phong illumination

Specular reflection can be observed when a light is being shone on an object with shinyness value. The result of that is a specular highlight on the surface of the object. The light source's position and the viewing angle contributes to the specular highlight's position. The light source's intensity and color define it's size and color

Reflections

Reflections are implemented by casting rays from the light source to an object and then by casting a reflection ray from intersection point of the object, directed along the reflection vector. This method is used recursively to add realism by allowing for multiple reflections in the scene.

Refractions (glass bunny)

5

tracey's People

Contributors

nullsense avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tracey's Issues

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.