Currently there is no way to declare what properties a material has, and so it is easy to accidentally set a non-existent property on a material (e.g. by misspelling the name of the property when trying to set its value) which results in silently buggy behavior. An improvement would be to declare all properties within the material file and register them with the Material instance when creating the material. Then if the user ever tries to set a property that doesn't exist we can treat it as an error, making rendering issues easier to debug for the user. This also allows us to simplify shader code by allowing the user to omit uniform declarations since those declarations can now be injected programmatically based on the property declarations.
Currently there is no way to declare what properties a material has, and so it is easy to accidentally set a non-existent property on a material (e.g. by misspelling the name of the property when trying to set its value) which results in silently buggy behavior. An improvement would be to declare all properties within the material file and register them with the
Material
instance when creating the material. Then if the user ever tries to set a property that doesn't exist we can treat it as an error, making rendering issues easier to debug for the user. This also allows us to simplify shader code by allowing the user to omit uniform declarations since those declarations can now be injected programmatically based on the property declarations.