@@ -43,12 +43,9 @@ pub fn evaluate_delta_point_light<Id: SceneId>(
4343 let shading_point_tangent = render_to_tangent * shading_point;
4444 let material_result = bsdf. evaluate ( lambda, & wo, & wi, & shading_point_tangent) ;
4545
46- // Normal mappingされた表面法線に対するcos項
4746 let distance_squared = distance_vector. length_squared ( ) ;
48- let cos_theta = material_result. normal . dot ( wi) . abs ( ) ;
4947
50- material_result. f * & intensity. intensity * cos_theta
51- / ( distance_squared * light_probability)
48+ material_result. f * & intensity. intensity / ( distance_squared * light_probability)
5249 } else {
5350 SampledSpectrum :: zero ( )
5451 }
@@ -75,10 +72,7 @@ pub fn evaluate_delta_directional_light<Id: SceneId>(
7572 let shading_point_tangent = render_to_tangent * shading_point;
7673 let material_result = bsdf. evaluate ( lambda, & wo, & wi, & shading_point_tangent) ;
7774
78- // Normal mappingされた表面法線に対するcos項
79- let cos_theta = material_result. normal . dot ( wi) . abs ( ) ;
80-
81- material_result. f * & intensity. intensity * cos_theta / light_probability
75+ material_result. f * & intensity. intensity / light_probability
8276 } else {
8377 SampledSpectrum :: zero ( )
8478 }
@@ -113,12 +107,11 @@ pub fn evaluate_area_light<Id: SceneId>(
113107 let material_result =
114108 bsdf. evaluate ( lambda, & wo_tangent, & wi_tangent, & shading_point_tangent) ;
115109
116- // 幾何項の計算
110+ // 幾何項の計算(シェーディングポイント側のコサイン項はBSDFに含まれるため別途計算不要)
117111 let distance2 = distance_vector. length_squared ( ) ;
118112 let light_normal = render_to_tangent * radiance. light_normal ; // VertexNormalTangent座標系に変換
119- let cos_material = material_result. normal . dot ( wi_tangent) . abs ( ) ; // VertexNormalTangent座標系で統一
120113 let cos_light = light_normal. dot ( -wi_tangent) . abs ( ) ; // VertexNormalTangent座標系で統一
121- let g = cos_material * cos_light / distance2;
114+ let g = cos_light / distance2;
122115
123116 material_result. f * & radiance. radiance * g / ( pdf * light_probability)
124117 } else {
@@ -153,12 +146,11 @@ pub fn evaluate_area_light_with_mis<Id: SceneId>(
153146 let pdf = radiance. pdf ;
154147 let material_result = bsdf. evaluate ( lambda, & wo, & wi, & shading_point_tangent) ;
155148
156- // 幾何項の計算
149+ // 幾何項の計算(シェーディングポイント側のコサイン項はBSDFに含まれるため別途計算不要)
157150 let distance2 = distance_vector. length_squared ( ) ;
158151 let light_normal = render_to_tangent * radiance. light_normal ;
159- let cos_material = material_result. normal . dot ( wi) . abs ( ) ;
160152 let cos_light = light_normal. dot ( -wi) . abs ( ) ;
161- let g = cos_material * cos_light / distance2;
153+ let g = cos_light / distance2;
162154
163155 // MISのウエイトを計算
164156 let pdf_light_dir = radiance. pdf_dir ;
@@ -200,9 +192,7 @@ pub fn evaluate_infinite_light<Id: SceneId>(
200192 let shading_point_tangent = render_to_tangent * shading_point;
201193 let material_result = bsdf. evaluate ( lambda, & wo, & wi, & shading_point_tangent) ;
202194
203- let cos_theta = material_result. normal . dot ( wi) . abs ( ) ;
204-
205- material_result. f * & radiance_sample. radiance * cos_theta
195+ material_result. f * & radiance_sample. radiance
206196 / ( radiance_sample. pdf_dir * light_probability)
207197 } else {
208198 SampledSpectrum :: zero ( )
@@ -231,14 +221,12 @@ pub fn evaluate_infinite_light_with_mis<Id: SceneId>(
231221 let shading_point_tangent = render_to_tangent * shading_point;
232222 let material_result = bsdf. evaluate ( lambda, & wo, & wi, & shading_point_tangent) ;
233223
234- let cos_theta = material_result. normal . dot ( wi) . abs ( ) ;
235-
236224 let pdf_light_dir = radiance_sample. pdf_dir ;
237225 let pdf_bsdf_dir = bsdf. pdf ( lambda, & wo, & wi, & shading_point_tangent) ;
238226 let mis_weight = balance_heuristic ( pdf_light_dir, pdf_bsdf_dir) ;
239227
240- let contribution = material_result . f * & radiance_sample . radiance * cos_theta
241- / ( pdf_light_dir * light_probability) ;
228+ let contribution =
229+ material_result . f * & radiance_sample . radiance / ( pdf_light_dir * light_probability) ;
242230
243231 NeeResult {
244232 contribution,
0 commit comments