Skip to content
/ RTCP Public

Main focus of this repo is to present basic path tracer using DXR - created application allows to move around and control how path tracing algorithm will be used (RTX 20/30 or GTX 16 required)

Notifications You must be signed in to change notification settings

komilll/RTCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RTCP - RayTracing Project

Project is being created as part of B.Sc. thesis. Original is not created in English, therefore below README file serves as summary for broader audience.

If you're interested in more detailed explanation, check English abstract of my thesis here - https://github.com/komilll/RTCP/blob/master/Images/Bachelor's%20thesis%20-%20abstract.pdf - it is low quality PDF so feel free to look at the gallery below for high quality images.

1. RTAO

RTAO is superior to SSAO because it doesn't rely only on screenspace information. It works with actual geometry which allows to correctly aproximate darkenings in creases and holes in objects. RTAO is finding occlusion by casting rays to actual geometry and it works fine even for small objects. However for SSAO, some radius has to be chosen. Too small radius might cause large objects to fail to render correctly. Too big will ignore small ones.

Implemention non-interactive RTAO can be done in few steps:

  1. Calculate world-space coordinates from NDC
  2. Find random direction in the hemipshere around normal
  3. Cast ray
  4. Depending on distance from origin, AO value is calculated. The closer hit is, the darker surface will be. It works that way because if point is surrounded by geometry it means that it'll get less light from environment

Full implementation can be find in RT_AO.hlsl file.

2. Path Tracing - GGX Visible Normals

Joe Schutte's blog - https://schuttejoe.github.io/post/ggximportancesamplingpart1/ - based on Heitz work, is providing discussion how to create PDF according to GGX NDF. NDF is most important when determining BRDF lobe shape. Therefore, we want to sample according to NDF. However there are some problems with this technique which causes fireflies. [Heitz2017] dealt with a problem by improvement of choosing direction of microfacet normal.

Detailed explanation is provided here - https://schuttejoe.github.io/post/ggximportancesamplingpart2/ - provided technique is very simple and fast, but results are noticeably better.

3. Postprocesses

It is important to use exposure settings. Generated image's brightness might differ based on number of samples and path length.

Apart from exposure, RTCP is using ACES Filmic Tone Mapper and at the end, result is converted from linear to sRGB colorspace. Full code is provided in PS_Postprocess.hlsl file.

4. Energy compensation

Due to multiple bounces of light, energy might be added or removed and it'll be not preserved to be correct at the end of path. [Turquin2019] solves problem in simple fashion. However, explanation is beyond scope of this README. You can find more informations about it here - https://blog.selfshadow.com/publications/turquin/ms_comp_final.pdf

5. Gallery

Diffuse + specular pathtracing - 5000 frames, path length - 8

Comparison with different frame count and path length

Exposure settings: -12.0, -10.0 (standard), -8.0

Energy compensation + energy compensation zoom (left: no energy compensation)

Top: random sampling, middle: uniform sampling, bottom: correlated multi-jittered sampling

Important links:

All links:

AO
Importance sampling:
Postprocesses:
PBR and shading models:
Other:
  • Schied et al. 2017 - Spatiotemporal Variance-Guided Filtering: Real-Time Reconstruction for Path-Traced Global Illumination https://research.nvidia.com/publication/2017-07_Spatiotemporal-Variance-Guided-Filtering%3A
  • Zwicker et. al 2015 - Recent Advances in Adaptive Sampling and Reconstructionfor Monte Carlo Rendering
  • Diede Apers, Petter Edblom, Charles de Rousiers, and Sébastien Hillaire (Electronic Arts) - Interactive Light Map and Irradiance Volume Preview in Frostbite
  • Johan Köhler (Treyarch) - Practical Order Independent Transparency
  • [Kajiya1986] James T. Kajiya - The Rendering Equation
  • [Green2003] Robin Green - Spherical Harmonic Lighting: The Gritty Details
  • [Whitted1980], Whitted et al - An Improved Illumination Model for Shaded Display

About

Main focus of this repo is to present basic path tracer using DXR - created application allows to move around and control how path tracing algorithm will be used (RTX 20/30 or GTX 16 required)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published