Three.js: Specular color map?

Created on 4 Oct 2015  路  10Comments  路  Source: mrdoob/three.js

Hi everyone.

Now the Specular map only controls the intensity of the specular highlights, it's will be great if we have Specular color map (http://wiki.polycount.com/wiki/Specular_color_map), one more step toward to the realistic material.

Specular Color Map

A texture that controls the intensity/color of the specular highlights from real-time lights.

Usually a specular map simply controls the brightness of the highlights, at a per-pixel level. If the shader supports RGB the specular map can be used to colorize specular highlights, useful for surfaces that have more complex reflective properties like metals, beetle shells, etc.

Enhancement

Most helpful comment

This is also one of the proposals of https://github.com/mrdoob/three.js/issues/16977. For that purpose, I think we'd want it on MeshPhysicalMaterial.

All 10 comments

We can add this to MeshPhongMaterial -- if there is interest. There hasn't been demand for it so far.

For the upcoming MeshPhysicalMaterial, I prefer to go with a metal-ness model, which is simpler for the average user, and does not require a specular map.

:+1:

@simonihmig What are you up-voting? What is your use case?

If I got it right, I can only influence the specular color via the specular property, but that affects the whole object. I have a single object (a person coming from a 3D scanner, not constructed by a human) with quite different "materials" (skin, clothes, shiny shoes, watch etc.), implemented as a single phong material with large texture maps. I would like to specify parts of that single material object as having a shiny surface (possible now with a specularMap) but also with different specular colors.

You got it right.

What is called specularMap in MeshPhongMaterial should have been named reflectivityMap. It is a grayscale map.

I'd like to revive this feature request since we have with 3MF a practical use case where a specular color map would be useful. I suggest the following:

  • Rename specularMap to reflectivityMap for MeshBasicMaterial, MeshLambertMaterial and MeshPhongMaterial and use it to modulate reflectivity.
  • Introduce specularMap (with new semantics) for MeshPhongMaterial only and (if set) use it instead of MeshPhongMaterial.specular.
  • Besides, one would assume a specularMap is defined in sRGB color space whereas reflectivityMap is defined in linear color space.

This is also one of the proposals of https://github.com/mrdoob/three.js/issues/16977. For that purpose, I think we'd want it on MeshPhysicalMaterial.

@Mugen87 that sounds good, but I think I would wait to see what GLTF decide first.

Oh, I was not aware that this topic is also discussed in the glTF space. But yeah, keep specularMap align with glTF sounds good 馃憤

The glTF working group is nearly decided on KHR_materials_specular now, which would involve...

  • specularColorTexture (RGB)
  • specularTexture (A)

... along with scalar factors for each. Feedback (or PRs! 馃槆) would be welcome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

boyravikumar picture boyravikumar  路  3Comments

konijn picture konijn  路  3Comments

donmccurdy picture donmccurdy  路  3Comments

filharvey picture filharvey  路  3Comments

Horray picture Horray  路  3Comments