Lab A06 GGX Lighting with GenAI
GGX Specular (F0 = 0.04, roughness = 0.1)

Blinn-Phong (beta = 1000, light colour = vec3(1.0))

The GGX Model
Fresnel
Smith One-sided Masking-Shadowing G1
Joint Masking-Shadowing G2
Task 6.1 Generate the vertex shader and fragment shader
Try to use GenAI tools to help generate the GGX fragment shader code.
You can use the same vertex shader from Blinn-Phong, the difference is in the fragment shader.
Task 6.2 Read the fragment shader functions
What kind of Normal Distribution Function and Smith masking-shadowing functions the source code is using ? They might be different from what is introduced the lecture.
Try to find correspondence between the variables in the code and in the GGX equation if your souce code is using functions similar to what has been introduced in the lecture.
Fresnel function
Normal distribution function (NDF)
Smith Masking-Shadowing function G1
Joint Smith Geometry Function G2(n,l,v)=G1(n,l)*G1(n,v)
The main GGX function
The GGX function calls NDF, FResnel, G2
Task 6.3 Try to understand the backbone of the code conceptablly
Task 6.4 Try to fit the code into your program and debug
Revise the Blinn-Phong fragment shader.
Try to replace the specular component with GGX. Setting F0 and roughness.
Create new GGX shader variables in main.cpp and use the GGX shader to render your models.
Improve your understanding of GGX with code fitting and debugging.
Task 6.5 Try to test different values of F0 and roughness
Task 6.6 Try to compare GGX rendering with Blinn-Phong
Last updated