Closed kvark closed 9 years ago
Actually, maybe we don't even want to provide ShaderParam
in the material? Since it's the technique that generates the shader, it can be solely responsible for the parameters. The material can just store stuff (textures, colors, flags), while the technique will update the shader parameters.
The "alpha" example only demonstrates gfx_phase
. Another one will be needed for gfx_scene
.
A simple example could be generating a cube mesh (with genmesh), then making 2 entities out of it: one with transparent material, and the other one with opaque. A technique could have the same shader but different draw states generated for these cubes.
TODO:
AbstractPhase
castingPartially blocked by https://github.com/gfx-rs/gfx-rs/issues/575 . Until it's done, we aren't going to be able to provide any shader parameters by the material.