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

Material uniform for mesh visualizer shaders.

Describes material properties referenced from MeshVisualizerDrawUniform2D::materialId and MeshVisualizerDrawUniform3D::materialId.

Constructors, destructors, conversion operators

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

Public variables

Color4 color
Base object color.
Color4 wireframeColor
Wireframe color.
Float wireframeWidth
Wireframe width.
Float colorMapOffset
Color map offset.
Float colorMapScale
Color map offset.
Float lineWidth
Line width.
Float lineLength
Line length.
Float smoothness
Line smoothness.

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 setColor(const Color4& color) -> MeshVisualizerMaterialUniform&
Set the color field.
auto setWireframeColor(const Color4& color) -> MeshVisualizerMaterialUniform&
Set the wireframeColor field.
auto setWireframeWidth(Float width) -> MeshVisualizerMaterialUniform&
Set the wireframeWidth field.
auto setColorMapTransformation(Float offset, Float scale) -> MeshVisualizerMaterialUniform&
Set the colorMapOffset and colorMapScale fields.
auto setLineWidth(Float width) -> MeshVisualizerMaterialUniform&
Set the lineWidth field.
auto setLineLength(Float length) -> MeshVisualizerMaterialUniform&
Set the lineLength field.
auto setSmoothness(Float smoothness) -> MeshVisualizerMaterialUniform&
Set the smoothness field.

Function documentation

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

Set the color field.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setWireframeColor(const Color4& color)

Set the wireframeColor field.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setWireframeWidth(Float width)

Set the wireframeWidth field.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setColorMapTransformation(Float offset, Float scale)

Set the colorMapOffset and colorMapScale fields.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setLineWidth(Float width)

Set the lineWidth field.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setLineLength(Float length)

Set the lineLength field.

Returns Reference to self (for method chaining)

MeshVisualizerMaterialUniform& Magnum::Shaders::MeshVisualizerMaterialUniform::setSmoothness(Float smoothness)

Set the smoothness field.

Returns Reference to self (for method chaining)

Variable documentation

Color4 Magnum::Shaders::MeshVisualizerMaterialUniform::color

Base object color.

Default value is 0xffffffff_rgbaf.

Used only if MeshVisualizerGL*D::Flag::Wireframe or Flag::InstancedObjectId / Flag::PrimitiveId / Flag::PrimitiveIdFromVertexId is enabled. In case of the latter, the color is multiplied with the color map coming from MeshVisualizerGL*D::bindColorMapTexture().

Color4 Magnum::Shaders::MeshVisualizerMaterialUniform::wireframeColor

Wireframe color.

Default value is 0x000000ff_rgbaf.

Used only if MeshVisualizerGL*D::Flag::Wireframe is enabled.

Float Magnum::Shaders::MeshVisualizerMaterialUniform::wireframeWidth

Wireframe width.

The value is in screen space (depending on MeshVisualizerGL*D::setViewportSize()), default value is 1.0f.

Used only if MeshVisualizerGL*D::Flag::Wireframe is enabled.

Float Magnum::Shaders::MeshVisualizerMaterialUniform::colorMapOffset

Color map offset.

Together with colorMapScale forms an offset and scale applied to the input value coming either from the MeshVisualizerGL*D::ObjectId attribute or gl_PrimitiveID, resulting value is then used to fetch a color from a color map bound with MeshVisualizerGL*D::bindColorMapTexture(). Default offset and scale values are 1.0f/512.0f and 1.0/256.0f, meaning that for a 256-entry colormap the first 256 values get an exact color from it and the next values will be either clamped to last color or repeated depending on the color map texture wrapping mode.

Used only if MeshVisualizerGL*D::Flag::InstancedObjectId or Flag::PrimitiveId / Flag::PrimitiveIdFromVertexId is enabled.

Float Magnum::Shaders::MeshVisualizerMaterialUniform::lineWidth

Line width.

The value is in screen space (depending on MeshVisualizerGL*D::setViewportSize()), default value is 1.0f.

Used only by MeshVisualizerGL3D and only if MeshVisualizerGL3D::Flag::TangentDirection, Flag::BitangentFromTangentDirection, Flag::BitangentDirection or Flag::NormalDirection is enabled.

Float Magnum::Shaders::MeshVisualizerMaterialUniform::lineLength

Line length.

The value is in object space, default value is 1.0f.

Used only by MeshVisualizerGL3D and only if MeshVisualizerGL3D::Flag::TangentDirection, Flag::BitangentFromTangentDirection, Flag::BitangentDirection or Flag::NormalDirection is enabled.