Skip to content

francesctr4/AGP-Deferred_PBR_SSAO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

152 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Graphics Programming - Delivery 3 - OpenGL Features: PBR + IBL & SSAO

Final Render

Team Members

Francesc Teruel Rodríguez

Mario García Sutil

Application Controls

Camera Controls

Action Input
Orbit Camera Alt + Right Mouse Button + Drag
Free Look Right Mouse Button + Drag
Move Forward W
Move Backward S
Move Left A
Move Right D
Move Up E
Move Down Q
Speed Boost Hold Shift (while moving)
Zoom In/Out Right Mouse Button + Scroll

Debug Keys

Action Key Description
GBuffer - Final Render 1 Shows final rendered output
GBuffer - Albedo 2 Displays albedo colors
GBuffer - Normals 3 Visualizes surface normals
GBuffer - Position 4 Shows world-space positions
GBuffer - View Direction 5 Displays camera-relative view vectors
GBuffer - Depth 6 Visualizes depth buffer
GBuffer - Ambient Occlusion 7 Shows Screen Space AO (SSAO) map
GBuffer - Metallic 8 Displays metallic values
GBuffer - Roughness 9 Visualizes roughness values
Cycle Cubemaps M Rotates through available cubemaps
Toggle Editor UI N Shows/hides editor interface
Cycle Rendering Modes B Switches between rendering techniques
PBR - Cycle Materials V Switches between PBR materials
PBR - Cycle Meshes C Switches between PBR meshes

Physically Based Rendering (PBR) + Image Based Lighting (IBL)

Physically-Based Rendering is a collection of render techniques that are based on the underlying lighting theory of the physical world. Image-Based Lighting is a collection of techniques to light objects, not by direct analytical lights, but by treating the surrounding environment as one big light source.

Showcase

image image image

Debug Widgets

Setting Name Purpose
Image Based Lighting Toggle IBL calculations on/off.
Metallic Influence Slider to alter the Metallic coeficient of the material.
Roughness Influence Slider to alter the Roughness coeficient of the material.

PBR - Debug Widgets

GBuffer Debug View to see all the attachments from GBuffer (including PBR)

image

GBuffer Debug View window also has IBL attachments available to display

image

Remember to check the other Debug Keys for additional interactions!

Shader Files

PBR

Shader Name Purpose
FORWARD_PBR_DIRECT_TEXTURED.glsl Computes direct lighting using the PBR model in a forward rendering textured pass.
FORWARD_PBR_IBL_TEXTURED.glsl Performs forward PBR rendering with both direct lighting influence and IBL. Uses precomputed environment maps for ambient lighting. Supports full texture-based material inputs.
DEFERRED_PBR_IBL_TEXTURED_GEOMETRY.glsl G-Buffer pass in deferred rendering. Writes PBR-relevant surface data (position, normal, albedo, metallic, roughness, ...) to textures for use in a later lighting pass.
DEFERRED_PBR_IBL_TEXTURED_QUAD.glsl Lighting/composition pass in deferred rendering. Reads the G-Buffer and applies lighting including IBL precomputed environment maps for ambient lighting.

IBL

Shader Name Purpose
EQUIRECTANGULAR_TO_CUBEMAP.glsl Converts an HDR equirectangular image (panoramic environment map) into a cubemap format for skyboxes and IBL.
SKYBOX.glsl Renders the cubemap as a skybox used for visual background and environment reflection source.
DIFFUSE_IRRADIANCE_CONVOLUTION.glsl Generates a low-frequency cubemap used for diffuse IBL, by convolving the environment map.
SPECULAR_PREFILTER_CONVOLUTION.glsl Generates a mipmapped cubemap used for specular IBL. Each mip level corresponds to different surface roughness.
BRDF_INTEGRATION_CONVOLUTION.glsl Precomputes a 2D lookup texture (BRDF LUT) used for the split-sum approximation in PBR specular IBL, based on roughness and view angle.

Screen Space Ambient Occlusion (SSAO)

Screen space ambient occlusion (SSAO) is a computer graphics technique for efficiently approximating the ambient occlusion effect in real time.

Showcase

Attachment Preview
Final Render
SSAO Pass
Final Render with SSAO

Debug Widgets

Setting Name Purpose
SSAO Status Toggle Screen Space Ambient Occlusion on/off.
AO Texture Toggle the PBR AO texture on/off.
Kernel Size Controls the number of sample points used to estimate occlusion; larger values can improve accuracy but reduce performance.
Radius Defines the sampling radius around each pixel in world space; determines how far to look for occluding geometry.
Bias Prevents self-occlusion artifacts (a.k.a. shadow acne) by ignoring very close geometry. Higher values reduce false occlusion but may miss subtle shadows.
Power Adjusts the final contrast or intensity of the ambient occlusion; higher values darken occluded areas more strongly.

image

Shader Files

Shader Name Purpose
SSAO.glsl Generate SSAO Texture
SSAO_BLUR.glsl Blur SSAO Texture
FORWARD_PRE_SSAO_RENDER.glsl (Blinn-Phong) Get Position and Normal Texture in Forward Rendering
FORWARD_SSAO_RENDER.glsl (Blinn-Phong) Forward Rendering using SSAO
DEFERRED_RENDER_GEOMETRY.glsl (Blinn-Phong) Deferred Rendering using SSAO
DEFERRED_RENDER_QUAD.glsl (Blinn-Phong) Deferred Rendering using SSAO
DEFERRED_PBR_IBL_TEXTURED_GEOMETRY.glsl (PBR) Deferred Rendering using SSAO
DEFERRED_PBR_IBL_TEXTURED_QUAD.glsl (PBR) Deferred Rendering using SSAO

Deferred Pipeline Breakdown

Attachment Preview
Albedo Albedo
Normals Normals
Position Position
View Direction View
Depth Depth
Ambient Occlusion AO
Metallic (PBR) Metallic
Roughness (PBR) Roughness
Skybox (IBL) Skybox
Irradiance (IBL) Irradiance
Prefilter (IBL) Prefilter
BRDF (IBL) BRDF
Final Render Final

Advanced Graphics Programming - Delivery 2 - Deferred Rendering

Final Result

Final Render

Deferred Pipeline Breakdown

Attachment Preview
Albedo Albedo
Normals Normals
Position Position
View Direction View
Depth Depth
Final Render Final
Stress Test Stress

About

Advanced Graphics Programming - Deferred PBR + IBL and SSAO implementation in C++ using OpenGL

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors