mrlem / siage3d

SImple Android Game Engine - 3D, the easy way
GNU General Public License v3.0
10 stars 0 forks source link

render: add a shader-graph API #52

Open mrlem opened 4 years ago

mrlem commented 4 years ago

Shaders are extremely rendundant: the current terrain shaders only has a few differences with the default shader.

These shaders currently hardcode all characteristics of materials / lights as being values or textures. This is not handy, as I cannot not in advance whether my material will use a texture or a value for its diffuse component. the same applies to specular & ambient components. Further than that, it might not be efficient to make all the shaders aware of shadow-maps. But the cost & maintenance required to have a single shader for each purpose would be overwhelming.

A shader-graph would allow full customization of what a shader supports. Some shaders should be included for most common needs.

The description should be achieved in a programmer-friendly way: DSL? Class based on high-level API?

mrlem commented 4 years ago

see SHADERS.md