Lighting

Description

sealed class Tinman.Engine.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

Ambient


[If("SHADER_PS")] [Pure]
public static method Ambient → (1)

normal in : float3

The unit-length normal vector.

returns → float3

The ambient term.

Computes the ambient lighting term, without occlusion.

Ambient​Occlusion


[If("SHADER_PS")] [Pure]
public static method AmbientOcclusion → (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.

Directional


[If("SHADER_PS")] [Pure]
public static method Directional → (1)

dotNormalLight in : float32

Dot product between normal vector and light vector.

returns → float4

The unscaled directional term (rgb) and the directional light intensity scale (a).

Computes the directional lighting term.

Emissive


[If("SHADER_PS")] [Pure]
public static method Emissive → (1)

emissive in : float3

The base emissive value.

returns → float3

The final emissive value.

Computes the emissive lighting term.

Environment


[If("SHADER_PS")] [Pure]
public static method Environment → (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.

Fake​Ggx


[If("SHADER_PS")] [Pure]
public static method FakeGgx → (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.

Fog


[If("SHADER_PS")] [Pure]
public static method Fog → (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.

Specular


[If("SHADER_PS")] [Pure]
public static method Specular → (3)

eye in : float3

The unit-length eye vector.

normal in : float3

The unit-length normal vector.

roughness in : float32

The material roughness.

returns → float3

The plain specular color sample.

Computes the partial specular lighting term.

Tone​Map


[If("SHADER_PS")] [Pure]
public static method ToneMap → (1)

color in : float3

The input HDR color.

returns → float3

The output LDR color.

Applies the tone mapping curve to the given HDR color.

Unlit


[If("SHADER_PS")] [Pure]
public static method Unlit → (5)

color in : float3

The input color.

occlusion in : float32

The output ambient occlusion value, as returned by AmbientOcclusion.

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.

Warp


[If("SHADER_PS")] [Pure]
public static method Warp → (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.