NVlabs / nvdiffrec

Official code for the CVPR 2022 (oral) paper "Extracting Triangular 3D Models, Materials, and Lighting From Images".
Other
2.09k stars 222 forks source link

some confusion on the bsdf #109

Closed wasahaiah closed 1 year ago

wasahaiah commented 1 year ago

Dear author: thank you for your great works. I have some confusion on the bsdf:

in function "bsdf_pbr_specular(col, nrm, wo, wi, alpha, min_roughness=0.08)", why "w = F D G * 0.25 / torch.clamp(woDotN, min=specular_epsilon)"

it seems that "w" is "w = F D G 0.25 / (torch.clamp(woDotN, min=specular_epsilon) torch.clamp(wiDotN, min=specular_epsilon) )" ?

Another confusion

In function "compute_tangents", the notes "# Normalize and make sure tangent is perpendicular to normal" seems not right. In order to ensure that tangent is perpendicular to normal, the tangent as if needs to be calculated by the following: "tangents = util.safe_normalize(tangents)" "tangents = util.safe_normalize(tangents - util.dot(tangents, imesh.v_nrm) / util.dot(imesh.v_nrm, imesh.v_nrm) * imesh.v_nrm)"