Camera

Description

sealed class Tinman.Shaders.Camera

Derived from

GpuCode abstract

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

Helper methods for computations related to the scene camera.

Public / Methods

Compute​Depth


[Pure]
public static method ComputeDepth → (1)

in : float32

The linear Z-coordinate value, between zero and the coordinate of the far clipping plane.

returns → float32

The logarithmic depth value in the range [0..1].

Computes the logarithmic depth value.

Compute​Dot​Direction


[Pure]
public static method ComputeDotDirection → (2)

locked in : bool

Use locked camera direction?

position in : float3

The camera-centric vertex position.

returns → float4

The camera-centric vertex position (xyz) and the dot product of the vertex position and the camera direction (w).

Augments the given position with the Z-distance along the camera direction.

Compute​Position


[Pure]
public static method ComputePosition → (3)

locked in : bool

Use locked camera position?

position in : float3

The world-space vertex position.

positionExtra in : float3

The precision delta of the world-space vertex position.

returns → float3

The camera-centric vertex position.

Computes the camera-centric vertex position.

Compute​Z


[Pure]
public static method ComputeZ → (2)

in : float32

The Z-coordinate of the transformed vertex position.

in : float32

The W-coordinate of the transformed vertex position.

returns → float32

The logarithmic depth coordinate, to be used as replacement for in.

Computes the logarithmic depth coordinate.

The transformation matrix that has produced in and in must be consistent with Configuration.NEAR_AT_ZERO.

Project​Position

2 overloads


[Pure]
public static method ProjectPosition1 → (1)

position in : float3

The camera-centric vertex position.

returns → float4

The projected vertex position.

Projects the given vertex position.


[Pure]
public static method ProjectPosition2 → (2)

position in : float3

The camera-centric vertex position.

out : float32

Output of linear depth value (input for ComputeZ), for interpolation in pixel shader.

returns → float4

The projected vertex position.

Projects the given vertex position (logarithmic depth).

Project​Position​Shadow


[Pure]
public static method ProjectPositionShadow → (2)

position in : float3

The camera-centric vertex position.

out : float2

Output of unclamped linear depth values (Z- and W-components), for interpolation in pixel shader.

returns → float4

The projected vertex position (clamped linear depth).

Projects the given vertex position.