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

Light parameters for Phong shaders.

Describes light properties for each light used by the shader, either all PhongGL::lightCount() or the subrange referenced by the PhongDrawUniform::lightOffset and PhongDrawUniform::lightCount range if PhongGL::Flag::LightCulling is enabled.

Constructors, destructors, conversion operators

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

Public variables

Vector4 position
Position.
Color3 color
Color.
Color3 specularColor
Specular color.
Float range
Attenuation range.

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 setPosition(const Vector4& position) -> PhongLightUniform&
Set the position field.
auto setColor(const Color3& color) -> PhongLightUniform&
Set the color field.
auto setSpecularColor(const Color3& specularColor) -> PhongLightUniform&
Set the specularColor field.
auto setRange(Float range) -> PhongLightUniform&
Set the range field.

Function documentation

PhongLightUniform& Magnum::Shaders::PhongLightUniform::setPosition(const Vector4& position)

Set the position field.

Returns Reference to self (for method chaining)

PhongLightUniform& Magnum::Shaders::PhongLightUniform::setColor(const Color3& color)

Set the color field.

Returns Reference to self (for method chaining)

PhongLightUniform& Magnum::Shaders::PhongLightUniform::setSpecularColor(const Color3& specularColor)

Set the specularColor field.

Returns Reference to self (for method chaining)

PhongLightUniform& Magnum::Shaders::PhongLightUniform::setRange(Float range)

Set the range field.

Returns Reference to self (for method chaining)

Variable documentation

Vector4 Magnum::Shaders::PhongLightUniform::position

Position.

Depending on the fourth component, the value is treated as either a camera-relative position of a point light, if the fourth component is 1.0f; or a direction to a directional light, if the fourth component is 0.0f. Default value is {0.0f, 0.0f, 1.0f, 0.0f} — a directional "fill" light coming from the camera.

Color3 Magnum::Shaders::PhongLightUniform::color

Color.

Default value is 0xffffff_rgbf.

Color3 Magnum::Shaders::PhongLightUniform::specularColor

Specular color.

Usually you'd set this value to the same as color, but it allows for greater flexibility such as disabling specular highlights on certain lights. Default value is 0xffffff_rgbf.

Float Magnum::Shaders::PhongLightUniform::range

Attenuation range.

Default value is Constants::inf().