IEnvironmentMap

Description

interface Tinman.Engine.Components.IEnvironmentMap

Derived from

IVersioned
ILightProvider
IResourceHandle

Extended by

EnvironmentMap abstract

Base interface for classes that compute color samples of an environment map.

An environment map uses a horizontal coordinate system with altitude and azimuth coordinates, interpreted as follows, with respect to the view direction:

  • altitude = +90° : towards zenith of upper hemisphere

  • altitude = 0° : towards horizon

  • altitude = -90° : towards zenith of lower hemisphere

  • azimuth = 0° : northwards

  • azimuth = +90° : eastwards

  • azimuth = +/- 180° : southwards

  • azimuth = -90° : westwards

Usually, environment maps are associated with some topocentric coordinate system in a 3D scene.

Environment maps are used to render background skies and to model the visual appearance of material reflectivity and gloss. For this purpose, an environment map is rasterized into a ColorCube and then encoded as a mipmapped cubemap texture, which in turn is used during rendering. Ambient lighting is computed from the smallest mipmaps, thus mimicking hemispheric sampling. If an environment map contains a single prominent light feature, it may expose it via the ILightProvider.LightAltitude, ILightProvider.LightAzimuth and ILightProvider.LightSize properties. These will be then used for diffuse lighting.

IEnvironmentMap objects act as resource handles and produce EnvironmentMapResource resource objects.

Public / Methods

ComputeEnvironmentColor


[Pure]
public method ComputeEnvironmentColor → (2)

altitude in : float64

Altitude angle of the view direction, in the range [-90..90] degrees.

azimuth in : float64

Azimuth angle of the view direction, in the range [-180..180] degrees.

returns → int64

The computed environment map color.

Computes the environment color at the given coordinates.

See also

Colors

Extensions

Rasterize


public static method Rasterize → (2)

cube in : ColorCube

[not-null]
The output color cube.

edgeFixup opt : bool = true

Perform edge fixup during rasterization? During rendering, the non-principal axes of the cubemap texture coordinates then need to be scaled by the factor 1-0.5/n, where n is the cubemap texture size, divided by two.

Rasterizes this environment map into the given color cube.