TalonBraveInfo / OpenHoW

Open-source reimplementation of Gremlin's Hogs of War (PC/PSX).
http://talonbrave.info
GNU General Public License v3.0
166 stars 12 forks source link

Material sub-system #141

Closed hogsy closed 3 years ago

hogsy commented 4 years ago

Goes in hand with the changes introduced earlier for the shaders.

May depend on a layer around PLMesh or PLModel to incorporate the changes.

API Example

Material* material = Engine::Resources()->LoadMaterial("materials/example.material");

Example

(default.program)
{
    "gl3": {
        "vertPath":"shaders/gl3/default.vert",
        "fragPath":"shaders/gl3/default.frag"
    }
}

(example.material)
{
    "shaderProgram":"shaders/default.program", (use the default shader program)
    "properties": [
        "diffuse":"materials/example.png",
        "specular":"materials/example_s.png",
        "exponent":0.5
    ]
}