This repository contains a GPU-based path tracer implemented using OpenGL 4.6 compute shaders.
The project was developed as part of a university graphics course. The primary motivation was to implement path tracing on older GPUs without dedicated ray tracing cores. Given that OpenGL does not provide native GPU-accelerated ray tracing, this project demonstrates a fully shader-based approach. The renderer evaluates the rendering equation stochastically and progressively converges to physically plausible images through frame accumulation.
The presentation slides can be found here.
The project report can be found here.
Included in this repository are several models located at:
PathTracer/PathTracerEditor/Assets/Models
You can experiment with these models or create your own scenes. (See the screenshots for some examples)
- Physically Based Path Tracing
- GGX Microfacet BRDF with Smith shadowing-masking
- Metallic–roughness workflow (glTF-style)
- Energy-conserving diffuse and specular shading
- Bindless texture support (GL_ARB_bindless_texture) for zero-overhead material sampling
- Multiple Importance Sampling (MIS)
- Samplers
- Cosine-weighted hemisphere sampling for diffuse lobes
- VNDF (Visible Normal Distribution Function) sampling for specular lobes
- Direct Lighting
- Directional light (sun) with Next Event Estimation
- Shadow ray visibility testing
- Environment Lighting
- Simple gradient-based sky model
- Bounding Volume Hierarchy (BVH) using Binning
- CPU-side generation
- GPU-side traversal
First of all, these requirements must be fullfilled in order to run this PathTracer.
- VS 2022 or 2026
- GPU with support for OpenGL 4.6
- Support for:
GL_ARB_bindless_textureGL_NV_gpu_shader5(or equivalent functionality)
Since this project already contains all the external dependencies, you can build it via Windows subsystems with Premake by running the Script Generate.bat.
git clone --recursive https://github.com/AAstroPhysiCS/PathTracer.git
cd PathTracer
./Generate.bat- Wavefront path tracing
- Atmospheric Rendering A Scalable and Production Ready Sky and Atmosphere Rendering Technique
- GPU-side BVH construction
- Advanced Denoising (Optix or SVGF (Spatiotemporal Variance-Guided Filtering))
- Subsurface scattering
- Motion blur and depth of field
-
Pharr, M., Jakob, W., & Humphreys, G. (2024).
Physically Based Rendering: From Theory to Implementation (4rd ed.).
Morgan Kaufmann. -
Walter, B., Marschner, S. R., Li, H., & Torrance, K. E. (2007).
Microfacet Models for Refraction through Rough Surfaces.
Proceedings of the Eurographics Symposium on Rendering. -
Heitz, E. (2014).
Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs.
Journal of Computer Graphics Techniques (JCGT), 3(2). -
Heitz, E. (2018).
Sampling the GGX Distribution of Visible Normals.
Journal of Computer Graphics Techniques (JCGT), 7(4). -
Veach, E., & Guibas, L. J. (1995).
Optimally Combining Sampling Techniques for Monte Carlo Rendering.
Proceedings of SIGGRAPH 1995. -
Narkowicz, K. (2015).
ACES Filmic Tone Mapping Curve.
Self Shadow Blog. -
Reed, J. (2016).
Hash Functions for GPU Rendering.
Reedbeta Blog. -
Auziaffe, M. (2024).
VNDF Importance Sampling for Isotropic GGX Distributions.
Technical Blog Article.



