api-issue-tracker
api-issue-tracker copied to clipboard
SUMaterialSet[Metalness/Roughness/etc]Enabled() is ignored if we set values after calling it
Disabling a PBR attribute with SUMaterialSetMetalnessEnabled(material, false) is reverted if we later set related values:
SUMaterialSetMetalnessEnabled(material, false);
SUMaterialSetMetallicFactor(material, metalness); // becomes enabled
SUMaterialSetMetallicTexture(material, suTexture); // becomes enabled
To make this work as I expected, I actually have to disable the PBR attribute last:
SUMaterialSetMetallicFactor(material, metalness);
SUMaterialSetMetallicTexture(material, suTexture);
SUMaterialSetMetalnessEnabled(material, false); // will stay disabled, and the material keeps the previous values
Same thing with the other attributes like roughness and normal (haven't tested AO).
This is either an unintended bug or it should be mentionned in the API documentation to avoid surprising users :)
Logged as: SKEXT-4663