Material
This class is not intended to be used directly. Use one of the concrete material types such as PhongMaterial, UnlitMaterial, ShaderMaterial, or derive your own material implementation from this class.
Types
Material::Blending enum
Enumerates blending modes used for compositing this material.
| Value | Description |
|---|---|
| None | No blending (default) fragments overwrite existing pixels. |
| Normal | Standard alpha blending. |
| Additive | Adds fragment color to the framebuffer color. |
| Subtractive | Subtracts fragment color from the framebuffer color. |
| Multiply | Multiplies fragment color by the framebuffer color. |
Material::Type enum
Enumerates all supported material types.
| Value | Description |
|---|---|
| PhongMaterial | Implements the Blinn–Phong lighting model. |
| ShaderMaterial | Uses a custom shader program for rendering. |
| SpriteMaterial | Specialized material for 2D sprites and billboards. |
| UnlitMaterial | Renders without lighting; color appears as-is. |
| Length | Sentinel value representing the number of material types. |
Properties
Blending mode used when rendering this material.
Blending blending {Blending::Normal};depth_test bool
Enables depth testing.
bool depth_test {true};flat_shaded bool
Enables flat shading.
bool flat_shaded {false};fog bool
Enables scene fog for this material.
bool fog {true};opacity float
Value in the range indicating how transparent the material is. For opacity to have an effect, transparency must be enabled.
float opacity {1.0f};polygon_offset_factor float
Polygon offset factor used to mitigate z-fighting.
float polygon_offset_factor {0.0f};polygon_offset_units float
Polygon offset units used to mitigate z-fighting.
float polygon_offset_units {0.0f};transparent bool
Enables transparency for this material.
bool transparent {false};two_sided bool
Enables rendering both front and back faces of polygons.
bool two_sided {false};visible bool
Controls whether this material is visible when rendering.
bool visible {true};wireframe bool
Enables wireframe rendering.
bool wireframe {false};Functions
Identifies the concrete Material::Type of this material.
virtual Type Material::GetType() const=0;