struct hiro::shader::Material

Overview

Properties of a simple phong material. More…

#include <ShaderApi.h>

struct Material {
    // fields

    cogs::Color3f color { cogs::color::GRAY70 };
    float specular { 0.5f };
    float shininess { 60.0f };
    bool metallic { false };
    uint8_t __padding0 { 0 };
    uint16_t __padding1 { 0 };
    bool use_lighting { true };
    uint8_t __padding2 { 0 };
    uint16_t __padding3 { 0 };

    // construction

    Material();
    Material(const cogs::Color3f& col);
};

Detailed Documentation

Properties of a simple phong material.

Fields

cogs::Color3f color { cogs::color::GRAY70 }

Defines material color.

float specular { 0.5f }

Intensity of specular reflection. Should be in range <0,1>.

float shininess { 60.0f }

Phong shininess parameter. Bigger values result in smaller specular reflections.

bool metallic { false }

When a material is metallic, it uses only colored specular component.

bool use_lighting { true }

Can be used to disable lighting and colorize the output with unmodified material color.

Construction

Material()

Creates a default material.

Material(const cogs::Color3f& col)

Creates a default material with a specified color.