hadronized / quaazar

Realtime 3D engine
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

User-driven shader #67

Closed hadronized closed 9 years ago

hadronized commented 9 years ago

Up to now, we have only one shading shader. It is located in a very specific place, in Lighting. Something great would be to enable the possibility to write user-defined shader, so that we can give objects a special aspects.

Then, such a shader should be outside Lighting.

All shaders have similar inputs, but the outputs might differ. In all ways, they are given the list of lights. Shaders can ignore lights (Bool?).

We have to be able to make Lit a Monoid so that we can apply a lighting technique onto it. The resulting type will be Shaded. The current Shaded has to be renamed. We actually haven’t have it anymore I guess.

Each raw data – i.e. Mesh – can be linked to an Entity. We have to add Material.

Now, what shade first argument should be? We need some kind of shader, but that’s more complex than that. We also need a way to pass values to that shaders. We could do the exact same thing as with PostFX.

hadronized commented 9 years ago

Done. Material doesn’t exist anymore and becomes a polymorphic type \o/.