NVIDIAGameWorks / Falcor

Real-Time Rendering Framework

Home Page:https://developer.nvidia.com/falcor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Incorrect normal calculation in Skinning.slang cause incorrect shading result

SonyKnakamura opened this issue · comments

In version 6.0, Skinning.slang do not compute normal vectors correctly when skinned mesh is deformed. This will cause wrong shading results as below.

Incorrect shading result (the arm part obviously reveals incorrect shading results):
image

This problem may be due to a change in normal calculations in Source/Falcor/Scene/Animation/Skinning.slang from the v5.2 update.

s.normal = mul((float3x3) transpose(invTransposeMat), s.normal);

https://github.com/NVIDIAGameWorks/Falcor/blame/9fdfdbb37516f4273e952a5e30b85af8ccfe171d/Source/Falcor/Scene/Animation/Skinning.slang#L159

Correct shading result can be obtained by modifying the relevant line like this:

s.normal = mul((float3x3) invTransposeMat, s.normal);

Correct shading result:
image

Thanks for reporting, this slipped our tests! We confirmed the fix and it will be released soon as part of the next update.