mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
102.73k stars 35.38k forks source link

Incorrect normal map with material.side = THREE.BackSide + vertex tangents #25701

Open donmccurdy opened 1 year ago

donmccurdy commented 1 year ago

Description

Mentioned by @WestLangley in https://github.com/mrdoob/three.js/pull/25580#issuecomment-1464746778, normal maps are displayed incorrectly when material.side === THREE.BackSide and the geometry uses vertex tangents.

Reproduction steps

  1. Create a geometry with vertex tangents
  2. Create two material with the same normal map, one front-sided and one back-sided
  3. Extrusions on one side should appear as indentations on the other side
donmccurdy commented 1 year ago

To test this thoroughly, I believe we'll need to consider all permutations of the options below:

@WestLangley @elalish have I missed anything? Or are there any of these we can ignore?

donmccurdy commented 1 year ago

I'll try to create a scene to reproduce the issue soon, but I don't expect to have a fix for this before the r151 release. If this blocks other work (#25693?) we should discuss options.

elalish commented 1 year ago

SGTM. The only of those that are available in glTF (so far as I know) are:

If we could also export a scene with that subset as GLB, it would be a great model to add to the gltf-sample-models repo. That would also make it easier to catch regressions using MV's fidelity tests.

elalish commented 1 year ago

FYI @emackey