File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -322,16 +322,16 @@ struct Scene {
322322 // TODO: smooth out dPdu and dPdv by storing per vertex tangents
323323 }
324324
325- // L represent planes constructed from opposite points
326- // scaled to return 1.0 for scalar product with itself
327- Vec3 La = vb .cross (vc);
328- La /= dot (va, La);
325+ // L represent planes constructed from opposite points perpendicular
326+ // to N and scaled to return 1.0 for scalar product with itself
327+ Vec3 La = n .cross (vc - vb );
328+ La /= dot (va - vb , La);
329329
330- Vec3 Lb = va .cross (vc);
331- Lb /= dot (vb, Lb);
330+ Vec3 Lb = n .cross (va - vc);
331+ Lb /= dot (vb - vc , Lb);
332332
333- Vec3 Lc = va .cross (vb);
334- Lc /= dot (vc, Lc);
333+ Vec3 Lc = n .cross (vb - va );
334+ Lc /= dot (vc - va , Lc);
335335
336336 Vec2 dTdx = dot (La, p.dx ()) * ta +
337337 dot (Lb, p.dx ()) * tb +
You can’t perform that action at this time.
0 commit comments