randomPoison / gunship-rs

An experimental game engine written in Rust.
MIT License
27 stars 3 forks source link

Add Material Properties #69

Closed randomPoison closed 8 years ago

randomPoison commented 8 years ago

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.

randomPoison commented 8 years ago

Closed by #70