1. Do not transform tangents/bitangents by normal matrix; use world matrix inste...

@zeux@mastodon.gamedev.place

1. Do not transform tangents/bitangents by normal matrix; use world matrix instead! This is a very frequent mistake that results in broken lighting for non-uniformly-scaled objects.

2. Reconstruct bitangent in world space if you use orthogonal tangent frames! Reconstructing in object space and *then* transforming leads to skewed transformed frames.

3. For normals, use cofactor matrix (aka transposed adjugate), not inverse-transpose! Saves det/div and is correct if one scale component is 0.