KhronosGroup / glTF-Sample-Viewer

Physically-Based Rendering in glTF 2.0 using WebGL
Apache License 2.0
1.29k stars 238 forks source link

Normal map rendering errors #521

Closed echadwick-artist closed 9 months ago

echadwick-artist commented 11 months ago

Normal maps seem to be rendering incorrectly in the sample viewer.

NormalTangentTest 2023-12-23 08_24_53-glTF Sample Viewer

I noticed this when testing a new model for the glTF Sample Assets repo, which is made to test the rendering of normal maps which have been baked from high-resolution geometry into the UVs of lower-resolutions geometry: https://github.com/KhronosGroup/glTF-Sample-Assets/pull/88

The three cubes in the middle should be lit similarly to the cube at the top, but they are not. screenshot_Large

Compare with how it is rendered in the Babylon.js Sandbox: https://sandbox.babylonjs.com/ BabylonJSSandbox

See also the ground-truth renderer Dassault Systèmes Enterprise PBR Pathtracer: https://dassaultsystemes-technology.github.io/dspbr-pt/ EnterprisePBRSampleRenderer

echadwick-dgg3d commented 9 months ago

Thanks for the fix!