-
Hello, I have a rendering job that requires relatively noise-free images and gradients. In order to render a 256 x 512 image with relatively high sample count (> 2^18 SPP), I have been rendering in multiple passes (using different seeds for each pass) & averaging the result. Is there a similar way to render an auto-diff gradient in multiple passes? I have included code for what I think it should be, and would appreciate guidance here. Thank you. import mitsuba as mi
import drjit as dr
scene = mi.load_file('./cbox/cbox.xml')
params = mi.traverse(scene)
key = 'green.reflectance.value'
single_spp = 2**14
nRenders = 8
img_tmp = dr.zeros(mi.TensorXf, (res_h, res_w, 3))
grd_tmp = dr.zeros(mi.TensorXf, (res_h, res_w, 3))
for seed_num in range(nRenders):
img_tmp += mi.render(scene, params, spp=single_spp, seed=seed_num)
dr.forward(params[key])
grd_tmp += dr.grad(img_tmp)
image = img_tmp / nRenders
grad_image = grd_tmp / nRenders
mi.util.write_bitmap("image.png", image)
mi.util.write_bitmap("gradient.png", grad_image) |
Beta Was this translation helpful? Give feedback.
Answered by
merlinND
Oct 8, 2024
Replies: 1 comment 3 replies
-
Hello @coult099, Have you tried the |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
coult099
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello @coult099,
Have you tried the
seed_grad
argument ofmi.render()
?