Lighting

Description

sealed class Tinman.Shaders.Lighting

Derived from

GpuCode abstract

Full source code is included in the Tinman 3D SDK download.

Helper methods for computations related to scene lighting.

Public / Methods

Compute​Ambient​Occlusion


[Pure]
public static method ComputeAmbientOcclusion → (1)

ao in : float32

The input ambient occlusion value (vertex resp. occlusion map):
0 := no ambient lighting
1 := full ambient lighting

returns → float32

The output ambient occlusion value:
0 := no ambient lighting
1 := full ambient lighting

Computes the ambient occlusion value.

Compute​Fake​Ggx


[Pure]
public static method ComputeFakeGgx → (2)

in : float32

The X-coordinate of the lookup vector.

in : float32

The Y-coordinate of the lookup vector.

returns → float2

The lookup sample.

Computes a fake sample that approximates the material reflectance lookup texture.

Compute​Fog


[Pure]
public static method ComputeFog → (3)

color in : float3

The base color.

eye in : float3

The unit-length eye vector.

distance in : float32

The camera distance.

returns → float3

The fog color value.

Computes the fog value.

Compute​Tone​Map


[Pure]
public static method ComputeToneMap → (1)

color in : float3

The input HDR color.

returns → float3

The output LDR color.

Applies the tone mapping curve to the given HDR color.

Compute​Unlit


[Pure]
public static method ComputeUnlit → (5)

color in : float3

The input color.

occlusion in : float32

The output ambient occlusion value, as returned by ComputeAmbientOcclusion.

normalDotEye in : float32

The absolute value of the dot product between the normal vector and the eye vector.

eye in : float3

The eye vector.

distance in : float32

The distance to the camera.

returns → float3

The unit color.

Computes an unlit color.

Cubemap​Warp


[Pure]
public static method CubemapWarp → (2)

direction in : float3

The direction vector.

warp in : float32

The spherical latitude offset, in radians.

returns → float3

The warped cubemap direction vector.

Warps the Y-coordinate of the given cubemap direction vector.

Environment​Sample


[Pure]
public static method EnvironmentSample → (2)

in : float3

The cubemap texture coordinates.

lod in : float32

The LOD-level to sample.

returns → float4

The sampled HDR color.

Samples the environment map with linear interpolation.

Filtering will not be seamless for Direct3D 9.

Environment​Sample​Seamless


[Pure]
public static method EnvironmentSampleSeamless → (2)

in : float3

The cubemap texture coordinates.

lod in : float32

The LOD-level to sample.

returns → float4

The sampled HDR color.

Samples the environment map with high-quality seamless filtering.