Page MenuHome

Shadow terminator geometry offset - fix scale discrepancy between viewport and final render
ClosedPublic

Authored by Mikhail Matrosov (ktdfly) on May 9 2022, 2:59 PM.

Diff Detail

Repository
rC Cycles

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.May 9 2022, 4:28 PM

I think the point of this change is to get rid of the normalize in object_normal_transform? However object_dir_transform is not exactly the same. For non-uniform scaled objects it's important to use the inverse transpose matrix.

So the better solution may be to add a object_normal_transform_unnormalized function to use here.

This revision now requires changes to proceed.May 9 2022, 4:28 PM

I think the point of this change is to get rid of the normalize in object_normal_transform? However object_dir_transform is not exactly the same. For non-uniform scaled objects it's important to use the inverse transpose matrix. So the better solution may be to add a object_normal_transform_unnormalized function to use here.

I need vector n to be treated as an elevation above a triangle and to be transformed as if there was a point. object_dir_transform does the trick. My experiments also show that object_normal_transform_unnormalized would introduce new artifacts:

It's a shadow from the right object

This revision is now accepted and ready to land.May 10 2022, 6:50 PM

You're right, seems to be fine as is.