MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Add a default value input for geomcolor

Open crydalch opened this issue 1 year ago • 4 comments

It would be nice if Geometry Color could specify a default value, so that users can choose what color to provide when the geometry property is missing.

Currently, many people just use Geom Prop Value, because you can specify the default color.

Thanks!

crydalch avatar Jan 17 '24 20:01 crydalch

Would there be a problem with geomcolor adding a default input, but have it default to 0,0,0 (like it currently seems to do)?

crydalch avatar Jan 17 '24 20:01 crydalch

That sounds very reasonable to me, @crydalch, and I'm CC'ing @dbsmythe for his thoughts. Here are the current interfaces for geomcolor, where the default zero values are hardcoded in the output elements:

https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/stdlib_defs.mtlx#L1277

jstone-lucasfilm avatar Jan 17 '24 21:01 jstone-lucasfilm

There is this related Slack thread started by @hybridherbst which encompasses geomprop: https://academysoftwarefdn.slack.com/archives/C02HJH53RN3/p1705501236612989

kwokcb avatar Jan 18 '24 19:01 kwokcb

I think

  • vertex color could also default to (1,1,1) (that's what it does in other formats/renderers), since a common usage is baseColor = baseColorFactor * baseColorMap * vertexColor
  • uv should default to (0,0)
  • normal should default to something calculated if it isn't provided probably

hybridherbst avatar Jan 18 '24 20:01 hybridherbst