UnityGLTF icon indicating copy to clipboard operation
UnityGLTF copied to clipboard

Shaders don't mark any exposed properties as "Main Color"

Open andybak opened this issue 1 year ago • 2 comments

image

This breaks any code that uses "someMaterial.color" without checking and forces implementation of code paths specifically for UnityGLTF materials.

andybak avatar Mar 17 '24 17:03 andybak

Thanks — the ShaderGraphs in UnityGltf were compatible back to 2019.x where that didn’t exist, but now that we support 2021.x+ it’s a good idea to add that.

Worth noting that

breaks any code that uses "someMaterial.color" without checking

is a bit of a misnomer, code that doesn’t check it is already broken, not every shader even has a main color.

hybridherbst avatar Mar 18 '24 05:03 hybridherbst

@pfcDorn we should also add to the docs that shader properties in UnityGltf always match their glTF spec names for ease of use

hybridherbst avatar Mar 18 '24 05:03 hybridherbst