Camera

Description

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

Depth


[Pure]
public static method Depth → (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.

Dot​Direction


[Pure]
public static method DotDirection → (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.

Position


[Pure]
public static method Position → (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.

Project

2 overloads


[Pure]
public static method Project1 → (1)

position in : float3

The camera-centric vertex position.

returns → float4

The projected vertex position.

Projects the given vertex position.


[Pure]
public static method Project2 → (2)

position in : float3

The camera-centric vertex position.

out : float32

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

returns → float4

The projected vertex position.

Projects the given vertex position (logarithmic depth).

Project​Shadow


[Pure]
public static method ProjectShadow → (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.

Z


[Pure]
public static method Z → (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.