Open dogod621 opened 6 years ago
You are correct; pbrt currently incorrectly flips S in that case. :-(
Unfortunately, fixing this makes all bump maps go in the opposite direction (down rather than up and vice versa). Therefore, we'll save fixing this for pbrt-v4. I'll leave this bug report open so that the issue can be known.
Is it right if I changed to below code?
// Compute shading bitangent _ts_ for triangle and adjust _ss_
- Vector3f ts = Cross(ss, ns);
+ Vector3f ts = Cross(ns, ss);
======================================
and another question, when compute triangle Intersection, the SetShadingGeometry function get ss/ts and assgined to shading.dpdu/dpdv. But the ss and ts is not the original dpdu/dpdv, it's normalized and maybe rotated, is this right?
Hi,
I found the S vector in triangle mesh are inversed when computing SurfaceInteraction. And I found the code in "triangle.cpp" line 361:
it will corss ( s, n ) to get t,and corss ( t, n ) to update s. This behavior will inverse S vector. Am I right?![tt](https://user-images.githubusercontent.com/6807005/39497891-dd29a346-4dd7-11e8-9a61-9c3ea3195d2c.jpg)
I am so carefully check the local shading frame, because I define my BRDF's NDF data ( has it's own orientation ) under local shading frame. If this inversion of S vector is truth and I am not wrong. I need to fix my data to handle the inversion.