microsoft / glTF-Toolkit

A collection of tools for modifying and optimizing glTF assets
MIT License
295 stars 41 forks source link

NormalRoughnessMetallic packing needs to renormalize normals and compute roughness from normal variance #48

Closed najadojo closed 5 years ago

najadojo commented 5 years ago

Incorrect results are being produced from the NRM packing. The current algorithm does a simple value copy but to maintain comparative visual equality we need to renormalize the normal values and also compute roughness from normal variance.

Repro steps: Input Normal texture: input_normal

Input Metallic Roughness texture: input-mr

Expected NRM texture: correct-nrm

Actual NRM texture: packing_nrm_0