TODO: Add make file
This is a Vulkan Hybird PBR ray-raster. To be more specific, a deffered PBR renderer + raytraced shadows.
| PBR (shadow off) | Shadow |
|---|---|
![]() |
![]() |
- Deferred rendering
- PBR
- Raytraced shadows for
- point light
- IBL diffuse light
- IBL specular light
The idea of the pipeline is simple. During the offscreen render pass (the first stage of defferred rendering), information needed by the final dferred render pass is generated and stored in the g buffer. Raytracing pass also takes position and normal as input and ouput shadow map (constructs of three components), which is used as another input source by the final dferred render pass.
G buffer stores position, normal and other material information.
| color | position |
|---|---|
![]() |
![]() |
| normal | matrial |
|---|---|
![]() |
![]() |
Metallic, roughness nad ambient occlusion are baked in different channels of one texture.
| albedo | metallic |
|---|---|
![]() |
![]() |
| roughness | ambient occlusion |
|---|---|
![]() |
![]() |
The idea of ray tacing is simple. The good part of combining deferred rendering and raytracing is that we already have the normal and position of each fragment, which means the the stage of shooting rays from camera is saved for the sake of computation resource.
When we talk about shadow, we are talking about light and occlusion logic.
Shadow = Light + Occlusion Logic
In this project, we use ray tracing to find occlusion according to occlusion logic.
There are three light components in our PBR model:
- Direction/Point
- IBL diffuse component
- IBL specular component
We inverse the light and find location and look for these three types of occlusion with three rays for each fragment.












