Skip to content

CJT-Jackton/RayTracing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ray Tracing

Offline rendering application by ray tracing.

Features

  • Spatial data structure (k-d tree)
  • Photon mapping
  • Procedural texture

Requirements

C++14 or higher. Tested on MSVC v141, no tested on other comilper yet.

  • hlsl++ Vector, Matrix library provided a HLSL like syntax.
  • libpng Library to handle .PNG file.
  • png++ C++ wrapper for libpng library.

Screenshots (work in progress)

screenshot Reflection

screenshot Refraction & Translucent shadow

Shading

Phong shading model

phong

Blinn-Phong shading model

blinn-phong

Texture

Texture

Procedural Texture

A procedural texture compute the color while sampling instead of using stored data.

Checkerboard 2D

The checkerboard 2D procedural texture is pretty straightforward. If the sample point fall within the bottom-left or upper-right region it return the main color, otherwise it return the secondary color.

Checkerboard 2D Checkerboard 2D texture on the plane

Perlin noise

Perlin noise is a type of gradient noise developed by Ken Perlin in 1983[1]. This program use a improved version of Perlin noise[2]. The Java implementation written by Ken Perlin himself can be found here.

Perlin noise Perlin noise on the plane

Anti-aliasing

Multisample anti-aliasing with 4 rays per pixel. After tried out multiple sampling pattern, I found 4-Rooks pattern (Rotated grid supersampling) produced the best result in visual.

NoAA

No anti-aliasing.

MSAA4x

With MSAA4x anti-aliasing.

NoAA vs MSAA4x

Side by side comparison.

Tone mapping

There are multiple ways to convert the HDR image into LDR space. However the ACES film tone mapping is the most widely accepted and used tone mapping algorithm.

None

None

Reinhard

Reinhard

Ward's

Ward

ACES Filmic

ACES

Open Shading Language

Perlin Noise

Perlin Noise

Beer's Law

Beer's Law

Author

Jietong Chen

Releases

No releases published

Packages

No packages published

Languages