Blinn-Phong shading model:
L=CdiffN⋅L+Cspec(N⋅H)m
Cdiff: Diffuse color
Cspec: Specular color
N: Normal vector
L: Light direction vector
H: Half-angle vector (sight direction vector & light direction vector)
Which is also Normalized(L+V)
BRDF:
L=fBRDFcosθl
fBRDF=kdiffπCdiff+kspecVDF
DTR=π(cos2θh(Roughness2−1)+1)2Roughness2
F=F0+(1−F0)(1−cosθh)5
F0=Metalic×Albedo+(1−Metalic)×[0.04,0.04,0.04]
V=4cosθlcosθvGS−GGX(θl)GS−GGX(θv)
GS−GGX(θ)=k+(1−k)cosθcosθ
k=8(Roughness+1)2
kspec=F0
kdiff=(1−F0)(1−Metalic)
For Roughness:
L=fBRDFN⋅L
L=(kdiffπCdiff+kspecVDF)N⋅L
L=(kdiffπCdiff+kspec(4cosθlcosθvGS−GGX(θl)GS−GGX(θv))(π(cos2θh(Roughness2−1)+1)2Roughness2)F)N⋅L