Skip to content

AmbientLight

Represents a light that emits evenly in all directions.

An ambient light contributes a constant illumination to all objects in the scene, regardless of their position or orientation. It does not have a defined direction and therefore cannot cast shadows.

Ambient lighting is typically used to simulate indirect or global illumination and to prevent completely unlit regions in the scene.

cpp
auto ambient = vglx::AmbientLight::Create({
  .color = 0xFFFFFF,
  .intensity = 0.3f
});

INFO

Derives from Light and inherits all public properties and methods.

Construction

Constructors


AmbientLight()

Constructs an ambient light.

cpp
AmbientLight::AmbientLight(const Parameters& params);
ParameterDescription
paramsInitialization parameters for constructing the light.

Factories preferred


AmbientLight::Create() auto

Creates a shared instance of AmbientLight.

cpp
static auto AmbientLight::Create(const Parameters& params);
ParameterDescription
paramsInitialization parameters for constructing the light.

Types

AmbientLight::Parameters struct

Parameters for constructing an AmbientLight object.

ParameterDescription
color ColorLight color.
intensity floatLight intensity multiplier.

Functions

GetType() Light::Type virtual

Identifies this light as Light::Type::Ambient.

cpp
Type vglx::AmbientLight::GetType() const override;

Released under the MIT License.