uci-rendering / psdr-cuda

Path-space differentiable renderer
BSD 3-Clause "New" or "Revised" License
155 stars 11 forks source link

[Question] Can't find photon and importon mapping preprocess for boundary rendering #29

Closed LiuLinyun closed 2 years ago

LiuLinyun commented 2 years ago

I am reading this code with paper, and found there is no photon&importon mapping implementation, which is mentioned in paper PSDR, section 6.4 Next-Event Estimation and Importance Sampling, Grid-based importance sampling.

In boundary rendering code, primary edge rendering choose edges visible for cameras and secondary edge rendering choose edges directly emitted by lights in file src/integrator/direct.cpp and function eval_secondary_edge() and sample_boundary_segment_direct():

https://github.com/uci-rendering/psdr-cuda/blob/98981730e6abd8b07434cda14d62119c6a639f1b/src/integrator/direct.cpp#L226

I am puzzled about how boundary rendering stage can optimize edges' vertices position or transformation which can not be directly "seen" by camera and emitters both?

andyyankai commented 2 years ago

For the photon map, we don't have it in psdr_cuda(which is direct lighting only), please check our cpu code base: https://shuangz.com/projects/psdr-sg20/psdr-sg20_code.zip for edges' vertices that have no contribution to the primary/secondary boundary, its gradient value will simply be 0, so naive SGD per vertex will not move those vertex

LiuLinyun commented 2 years ago

Thanks a lot! I figured it out and I am trying to add indirect edges optimization based on this code.