Skip to content

unitycoder/Raytracing

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raytracing

This is a complete Unity project that implements raytracing using a compute shader. Runs at about 100-150 FPS (High Quality enabled) and 200-250 FPS (High Quality disabled) on a NVIDIA GTX 1060 (3 GB) @ 1080p with the included scene.

Raytracing

A large portion of the code is based off of the 3-part GPU Ray Tracing blog series, which can be found here. The blog post is great for learning how compute shaders work, and the fundamentals of raytracing.

Pre-requisites

  • Developed on Unity 2019.2.0f1. May still work with earlier versions of Unity.
  • A GPU with Shader Model 5.0 support.

Benefits over traditional, deferred rendering

  • Extremely accurate lighting.
  • Nearly infinite shadow distance and precision (no shadowmaps).
  • Pixel perfect reflections on every surface.

Drawbacks

  • Very expensive to render, especially on old hardware.
  • Performance degrades with more objects/lights in the scene.
  • Rendering geometry more complex than primitive shapes is unrealistic.
  • Everything is untextured due to the lack of UV maps.
  • Diffuse reflections requires the scene to be static to avoid smearing artifacts. The resulting image is also noisy when moving the camera around (due to random sampling).

About

A Unity project that experiments with raytracing and compute shaders.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HLSL 52.2%
  • C# 35.6%
  • ShaderLab 12.2%