donut
donut copied to clipboard
Non-Uniform Scale Transofrmation Support
in gbuffer_vs.hlsl:
o_vtx.normal = mul(instanceMatrix, float4(i_vtx.normal, 0)).xyz;
o_vtx.tangent.xyz = mul(instanceMatrix, float4(i_vtx.tangent.xyz, 0)).xyz;
o_vtx.tangent.w = i_vtx.tangent.w;
need to use transpose(inverse(instanceMatrix)).
Also Odd Negative Scale need to be taken into consideration.