Shadow

Description

sealed class Tinman.Shaders.Shadow

Derived from

GpuCode abstract

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

Helper methods for computations related to shadow mapping.

Public / Methods

Compute​Shadow


[Pure]
public static method ComputeShadow → (1)

position in : float4

xyz = Point in world-space for which to compute a shadow map sample.
w = Z-coordinate of point, in camera-space.

returns → float32

The shadow attenuation factor (0 := full shadow, 1 := no shadow).

Computes the shadow for the given point.

Write​Shadow


[If("SHADER_PS")] [Pure]
public static method WriteShadow → (2)

depth in : float32

The shadow depth in the range [0..1].

alpha in : float32

The alpha value to write.

returns → PS_Out_Target

The depth values to write into the shadowmap:
r = depth
g = squared depth
The alpha value to use for alpha-to-coverage:
a = alpha

Writes a shadow map sample for the given depth.