我找到一個合適的光照模型自己在documentation for .mtl files:
color = KaIa
+ Kd { SUM j=1..ls, (N*Lj)Ij }
+ Ks ({ SUM j=1..ls, ((H*Hj)^Ns)Ij Fr(Lj*Hj,Ks,Ns)Ij} +
Fr(N*V,Ks,Ns)Ir})
+ (1.0 - Kx)Ft (N*V,(1.0-Ks),Ns)TfIt
這是緻密且實際上具有一些錯字(如Kx
和Ft
),所以我糾正它:
I = Ka * Ia
+ Kd * [sum for each light: (N . L) * Il]
+ Ks * [sum for each light: ((R . V)^Ps) * Fl * Il]
+ Ks * Fr * Ir
+ Kt * (1 - Ks) * Ft * It
I := surface point's color
V := ray direction
P := surface point
N := surface normal
L := light's position - P
R := L - 2 * (N . L) * P
Ka := surface material's ambient coefficient
Kd := surface material's diffuse coefficient
Ks := surface material's specular coefficient
Ps := surface material's shininess
Kt := surface material's transmission coefficient
Ia := ambient light color
Il := light's color
Ir := reflected ray's color
It := transmitted ray's color
Fl := light's Fresnel coefficient
Fr := reflected Fresnel coefficient
Ft := transmitted Fresnel coefficient
這模型對我來說很有意義,尤其是在閱讀後Lighting 101 - Phong鏡面反射是一種反射光源的性能意識破解,所以自然而然地使用相同的係數來進行高光反射反射光線。
還有一件事我不明白。如果我不想打擾菲涅耳術語,我可以設置Fl
,Fr
和Ft
爲1.如果我想要額外的準確性,但是,我將如何根據我已定義的變量計算它們?
對於你的最後一個問題:就我所知,你需要材料的折射率來計算反射率和透射率的菲涅耳值。也不是指向Lighting 101的鏈接不再可用。編輯:.mtl文件鏈接的文檔也不可用。 – kleinfreund 2016-08-26 13:12:42
這兩個鏈接都走了:(但很好的研究 – muni764 2018-01-11 23:01:25