DavidBrainard / RenderToolbox3

Matlab toolbox for managing graphics rendering for psychophysics
MIT License
11 stars 4 forks source link

PBRT and Mitsuba disagree about orientation of area lights #18

Closed benjamin-heasly closed 11 years ago

benjamin-heasly commented 11 years ago

In the Interior scene, there are two rectangular area lights that should shine towards the origin.

One light is located along the negative x-axis. PBRT and Mitsuba agree on the orientation of this light.

The other light is located along the negative y-axis. PBRT and Mistuba have this light shining in opposite directions. I think Mitsuba is correct, because it has both lights shining down their internal z-axes.

This is probably an error in the polygon triangulation and vertex winding computed in ColladaToPBRT/ConvertGeometry().

benjamin-heasly commented 11 years ago

In Blender, I tried applying object rotations directly to the mesh data of the offending area light (control-A in Blender). The renderers still disagreed on the orientation of the light. So I don't think this is an problem with order of operations.

benjamin-heasly commented 11 years ago

I found the problem.

ConvertGeometry() was trying to compute vertex winding in an absolute sense, but it should have been trying to preserve the winding order of the original Collada polygon.

This is fixed in 74987fa5b245683cfc29ae37868fd79ccbca2c6a