Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTFLoader: Revert usage of computeTangents(). #21186

Merged
merged 1 commit into from
Feb 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3243,21 +3243,6 @@ THREE.GLTFLoader = ( function () {
? new THREE.SkinnedMesh( geometry, material )
: new THREE.Mesh( geometry, material );

// Fix double sided rendered models on certain mobile devices, see https://github.com/mrdoob/three.js/issues/20997#issuecomment-756082184

if ( material.isMeshStandardMaterial === true &&
material.side === THREE.DoubleSide &&
geometry.getIndex() !== null &&
geometry.hasAttribute( 'position' ) === true &&
geometry.hasAttribute( 'normal' ) === true &&
geometry.hasAttribute( 'uv' ) === true &&
geometry.hasAttribute( 'tangent' ) === false ) {

geometry.computeTangents();
material.vertexTangents = true;

}

if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) {

// we normalize floating point skin weight array to fix malformed assets (see #15319)
Expand Down
15 changes: 0 additions & 15 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3308,21 +3308,6 @@ var GLTFLoader = ( function () {
? new SkinnedMesh( geometry, material )
: new Mesh( geometry, material );

// Fix double sided rendered models on certain mobile devices, see https://github.com/mrdoob/three.js/issues/20997#issuecomment-756082184

if ( material.isMeshStandardMaterial === true &&
material.side === DoubleSide &&
geometry.getIndex() !== null &&
geometry.hasAttribute( 'position' ) === true &&
geometry.hasAttribute( 'normal' ) === true &&
geometry.hasAttribute( 'uv' ) === true &&
geometry.hasAttribute( 'tangent' ) === false ) {

geometry.computeTangents();
material.vertexTangents = true;

}

if ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) {

// we normalize floating point skin weight array to fix malformed assets (see #15319)
Expand Down