GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::SpotLightOptions3D Struct Reference

Configuration options for a point light source that is limited to a cone shape, which can be used to approximate e.g. a headlamp on a car. More...

#include <GREM/graphics_3d/Lights3D.hpp>

Public Member Functions

constexpr bool operator== (const SpotLightOptions3D &other) const noexcept=default
 Compare these options to another set of options for equality.

Public Attributes

vec3 position {0.0f, 0.0f, 0.0f}
 Position of the light, in world coordinates.
vec3 direction {0.0f, -1.0f, 0.0f}
 Vector representing the direction of the light, in world coordinates.
float range = 10.0f
 Maximum range of the light, in world coordinates, beyond which the light will have no effect, or a non-positive value for infinite range.
float innerConeAngle = convertDegreesToRadians(22.5f)
 Angle, from the light's direction axis, of the inner limit where the light cone is the brightest, in radians.
float outerConeAngle = convertDegreesToRadians(45.0f)
 Angle, from the light's direction axis, of the outer limit where the light cone fades to zero, in radians.
Color color = Color::WHITE
 Color of the light, where the alpha component controls the light's intensity.
float shadowNearZ = 0.01f
 Distance to the near plane of the light's shadow map.
float shadowFarZ = 100.0f
 Distance to the near plane of the light's shadow map.
float shadowMapNormalOffsetBiasConstantFactor = 0.04f
 Constant normal offset bias factor to use when sampling the shadow map of the light.
float shadowMapNormalOffsetBiasSlopeFactor = 1.0f
 Slope-scaled normal offset bias factor to use when sampling the shadow map of the light.
bool shadowMapped = true
 Whether the light should use shadow mapping or not.

Detailed Description

Configuration options for a point light source that is limited to a cone shape, which can be used to approximate e.g. a headlamp on a car.

Member Function Documentation

◆ operator==()

bool grem::graphics::SpotLightOptions3D::operator== ( const SpotLightOptions3D & other) const
nodiscardconstexprdefaultnoexcept

Compare these options to another set of options for equality.

Parameters
otherthe options to compare these to.
Returns
true if the options are equal, false otherwise.

Member Data Documentation

◆ position

vec3 grem::graphics::SpotLightOptions3D::position {0.0f, 0.0f, 0.0f}

Position of the light, in world coordinates.

◆ direction

vec3 grem::graphics::SpotLightOptions3D::direction {0.0f, -1.0f, 0.0f}

Vector representing the direction of the light, in world coordinates.

◆ range

float grem::graphics::SpotLightOptions3D::range = 10.0f

Maximum range of the light, in world coordinates, beyond which the light will have no effect, or a non-positive value for infinite range.

◆ innerConeAngle

float grem::graphics::SpotLightOptions3D::innerConeAngle = convertDegreesToRadians(22.5f)

Angle, from the light's direction axis, of the inner limit where the light cone is the brightest, in radians.

Must be less than or equal to outerConeAngle, and between 0 and pi radians (inclusive).

◆ outerConeAngle

float grem::graphics::SpotLightOptions3D::outerConeAngle = convertDegreesToRadians(45.0f)

Angle, from the light's direction axis, of the outer limit where the light cone fades to zero, in radians.

Must be greater than or equal to innerConeAngle, and between 0 and pi radians (inclusive).

◆ color

Color grem::graphics::SpotLightOptions3D::color = Color::WHITE

Color of the light, where the alpha component controls the light's intensity.

◆ shadowNearZ

float grem::graphics::SpotLightOptions3D::shadowNearZ = 0.01f

Distance to the near plane of the light's shadow map.

Must be less than or equal to shadowFarZ.

◆ shadowFarZ

float grem::graphics::SpotLightOptions3D::shadowFarZ = 100.0f

Distance to the near plane of the light's shadow map.

Must be greater than or equal to shadowNearZ.

◆ shadowMapNormalOffsetBiasConstantFactor

float grem::graphics::SpotLightOptions3D::shadowMapNormalOffsetBiasConstantFactor = 0.04f

Constant normal offset bias factor to use when sampling the shadow map of the light.

◆ shadowMapNormalOffsetBiasSlopeFactor

float grem::graphics::SpotLightOptions3D::shadowMapNormalOffsetBiasSlopeFactor = 1.0f

Slope-scaled normal offset bias factor to use when sampling the shadow map of the light.

◆ shadowMapped

bool grem::graphics::SpotLightOptions3D::shadowMapped = true

Whether the light should use shadow mapping or not.


The documentation for this struct was generated from the following file: