Closed dkasuga closed 5 years ago
I don't have time to look at the code yet but take a look at tests/test_svbrdf.py or tests/test_teapot_normal_map.py for examples of optimizing textures. Both diffuse reflectance & normal maps are supported.
OH, I accidentally overlooked tests / test_svbrdf.py. Thank you very much! However, another problem came up. I actually tried to execute tests/test_svbrdf.py after reflecting the latest repository, but the following Assertion Error appeared.
File "test_svbrdf.py", line 187, in <module>
max_bounces = 1)
File "/opt/conda/lib/python3.7/site-packages/pyredner/render_pytorch.py", line 109, in serialize_scene
assert (torch.isfinite (material.diffuse_reflectance.mipmap) .all ())
AssertionError
In details, line 187:
args = pyredner.RenderFunction.serialize_scene (\
scene = scene,
num_samples = 4,
max_bounces = 1)
Since this Assertion Error occurred at 100 iteration, I tried changing the number of iterations from 200 to 100 and then it worked.
Why is torch.isfinite (material.diffuse_reflectance.mipmap) broken if it is over 100 iterations?
Looks like a bug on my side. I think it is caused by the numerical issue of small roughness. Will fix it asap.
Should be fixed now. The problem was indeed due to small/negative roughness causing NaNs. I added some clamping code in the optimization script.
Thank you so mush for your prompt response and fix!!
Hello, I have a similar question to issue #52 . Can we optimize diffuse reflection texture? I've tried to implement the code to do this, but it raised "ValueError: can't optimize a non-leaf Tensor." Isn't there diffuse reflection texture support yet?
Thanks.