@@ -184,8 +184,9 @@ def check_fov(camera, sample):
184184}
185185
186186
187+ @pytest .mark .parametrize ("ray_differential" , [False , True ])
187188@pytest .mark .parametrize ("srf" , list (srf_dict .keys ()))
188- def test_srf (variant_scalar_spectral , srf ):
189+ def test_srf (variant_scalar_spectral , ray_differential , srf ):
189190 # Test the spectral response function specification feature
190191 from mitsuba .core .xml import load_dict
191192 from mitsuba .core import sample_shifted
@@ -201,13 +202,11 @@ def test_srf(variant_scalar_spectral, srf):
201202 wav_sample = 0.5
202203 pos_sample = [0.2 , 0.6 ]
203204
204- ray , spec_weight = camera .sample_ray_differential (
205- time , wav_sample , pos_sample , 0 )
205+ sample_func = camera .sample_ray_differential if ray_differential else camera . sample_ray
206+ ray , spec_weight = sample_func ( time , wav_sample , pos_sample , 0 )
206207
207208 # Importance sample wavelength and weight
208- print (sample_shifted (wav_sample ))
209209 wav , wav_weight = srf .sample_spectrum (SurfaceInteraction3f (), sample_shifted (wav_sample ))
210- print (wav )
211-
210+
212211 assert ek .allclose (ray .wavelengths , wav )
213212 assert ek .allclose (spec_weight , wav_weight )
0 commit comments