Model-viewer: Normals in 0.7 on some parts of the mesh look flipped

Created on 23 Oct 2019  路  9Comments  路  Source: google/model-viewer

Description

In 0.7 I'm noticing that parts of my mesh now look flipped.
See here: https://vaulted-jonquil.glitch.me/

This is what it should look like, with the pattern being indented on both wheels. That's how it was in 0.6
Screen Shot 2019-10-23 at 3 51 35 PM

In 0.7 though one of the wheels has the pattern looking like it's popping out:
Screen Shot 2019-10-23 at 3 51 27 PM

@elalish Could this be related to that three.js tangent bug?

Browser Affected

All

OS

All

Versions

  • model-viewer: v0.7.0
  • three.js: r108
compatibility rendering & effects bug

All 9 comments

In the three.js editor, it loads with double sided face rendering. It looks like this:

Screen Shot 2019-10-23 at 4 11 53 PM

That's the same as what model-viewer is showing.

If I switch to front facing only, it looks correct:

Screen Shot 2019-10-23 at 4 11 37 PM

Back facing:

Screen Shot 2019-10-23 at 4 11 44 PM

This seems to only affect double sided materials

This looks like a change in three, picked up because we bumped the version to r108 in 0.7. We've seen several other bugs related to double-sided materials. The advice from the three.js maintainers is to avoid them (they also cause a performance hit). Is it possible to remove "doubleSided" from the glTFs in this case?

@elalish In this case for this particular model, yeah, but we can't control what merchants on our platform are uploading. And if what they see in their authoring tool doesn't match what shows up on their product page, they'll be confused and think something's wrong.

I'd also appreciate if you could file this bug on three.js; that's the best way to figure out what's going on and get it fixed. I believe the fundamental problem is with a double-sided material it's not super clear which direction the normal map is supposed to point on each side. It's possible there is a correct answer, but I can see why it's a bug-prone area.

Shouldn't it just be in the direction that the normal is? The front face has it in the correct orientation, and the back has it flipped?

I fixed this, I think in v0.8 sometime.

Was this page helpful?
0 / 5 - 0 ratings