Three.js: MeshPhysicalMaterial: Add .transparencyMap

Created on 18 May 2020  ·  9Comments  ·  Source: mrdoob/three.js

Building on https://github.com/mrdoob/three.js/pull/17114, I'm proposing to add a .transparencyMap property to MeshPhysicalMaterial, as a texture alternative to .transparency. The two parameters combined would allow thin-surface optical transparency workflows.

Related:

Enhancement

All 9 comments

I'm proposing to add a .transparencyMap property to MeshPhysicalMaterial, as a texture alternative to .transparency.

So to clarify your proposal, even if the object was _uniformly_ transparent, a transparency map and UVs would be required. Is that what you are proposing?

No, sorry, just the same as we do for other .foo/.fooMap pairs. Either can be used in isolation, or they're linear multipliers when both are provided.

The difference in this case is that transparency is 0 by default though? Same as metalness I guess.

I had the same concern, but I think this is OK. transparency should be set to 1 by the loader if a map is present. The map attenuates the transparency.

Edit: Well, I am not sure if the loader should set it to 1, but the user should...

It does sort of make one's head spin...

Hm. I see what you mean.

I think it's OK, but the full list of...

  • .opacity
  • .alphaMap
  • .transparent
  • .transparency
  • .transparencyMap

... is a lot for users to understand. For what it's worth, glTF and Blender will use the term "transmission" rather than "transparency" when referring to this property. I expect the transmission property in a glTF file will also affect refraction and subsurface scattering when those features come to glTF (a fair bit later).

Maybe make a thin-surface material as an extension?

We should think about what types of physical materials we want MeshPhysicalMaterial to represent.

I had originally assumed that would be Metals and Plastics, and probably Ceramics. But we seem to be adding properties that allow it to model a lot of materials -- an Uber Material. I am not sure that is a good idea.

The list in https://github.com/mrdoob/three.js/issues/16977 is representative of what the more advanced glTF PBR model will allow, and very similar to Blender's Principled BSDF and Autodesk's Standard Surface as well.

Whether this all makes sense for MeshPhysicalMaterial I don't know. The alternatives to uber materials have their own complexities. I do not want to add any of these new features to MeshStandardMaterial, though, I think that has a pretty good scope already.

@WestLangley @mrdoob What do you think of renaming the .transparency parameter to .transmission? Especially since it is generally used with .transparent = false, I think transmission may be easier to understand... this seems to line up with other tools:

That sounds good to me 👍

Was this page helpful?
0 / 5 - 0 ratings