Magnum::Shaders::FlatMaterialUniform struct new in Git master

Material uniform for flat shaders.

Describes material properties referenced from FlatDrawUniform::materialId.

Constructors, destructors, conversion operators

FlatMaterialUniform(DefaultInitT = DefaultInit) explicit constexpr noexcept
Construct with default parameters.
FlatMaterialUniform(NoInitT) explicit noexcept
Construct without initializing the contents.

Public variables

Color4 color
Color.
Float alphaMask
Alpha mask value.

Convenience setters

Provided to allow the use of method chaining for populating a structure in a single expression, otherwise equivalent to accessing the fields directly. Also guaranteed to provide backwards compatibility when packing of the actual fields changes.

auto setAlphaMask(Float alphaMask) -> FlatMaterialUniform&
Set the alphaMask field.
auto setColor(const Color4& color) -> FlatMaterialUniform&
Set the color field.

Function documentation

FlatMaterialUniform& Magnum::Shaders::FlatMaterialUniform::setAlphaMask(Float alphaMask)

Set the alphaMask field.

Returns Reference to self (for method chaining)

FlatMaterialUniform& Magnum::Shaders::FlatMaterialUniform::setColor(const Color4& color)

Set the color field.

Returns Reference to self (for method chaining)

Variable documentation

Color4 Magnum::Shaders::FlatMaterialUniform::color

Color.

Default value is 0xffffffff_rgbaf.

If FlatGL::Flag::VertexColor is enabled, the color is multiplied with a color coming from the FlatGL::Color3 / FlatGL::Color4 attribute.

Float Magnum::Shaders::FlatMaterialUniform::alphaMask

Alpha mask value.

Fragments with alpha values smaller than the mask value will be discarded. Default value is 0.5f.

Used only if FlatGL::Flag::AlphaMask is enabled, ignored otherwise.