GpuCode

Description

abstract class Tinman.Gpu.GpuCode

Extended by

Camera sealed
Demo sealed
Example sealed
Graphics sealed
Lighting sealed
Mipmap sealed
Model sealed
Process sealed
Renderer sealed
Shadow sealed
Sky sealed
Terrain sealed
Triangulate sealed
Util sealed

This class is the base for GPU programs and provides a set of intrinsic functions that can be mapped to other GPU programming languages (like HLSL and GLSL) with zero or trivial effort.

A GPU program is a group of shader functions that reads data from one or more input resource object (such as IGpuBuffer or ITexture) and writes data to one or more output resource objects (such as IRenderTarget, IGpuBuffer or ITexture). If a class is derived from GpuCode, it becomes a GPU code class, which contains functions that will be executed by a GPU (after syntactic and semantic translation to GPU code, such as HLSL/GLSL, following by compilation and linking by the native graphics API). To define a shader function, a function of a GPU code class must be annotated with one of the following attributes, which turns the function into a pipeline stage:

Data may be passed between pipeline stages with struct values that are annotated with StageInOut. To pass data within a pipeline stage, struct values that are annotated with Stage may be used, in addition to values of the following types:

The following attributes may be used to specify value semantics and custom behaviour:

Constant data may be fed into a GPU program via constant buffers, which are defined via class types that are annotated with ConstantBuffer. GPU code reads values from a constant buffer by accessing the static fields and CPU code writes values via the IRenderEffectParameters interface, where the mapping between from constant buffer field name to parameter slot is obtained via IRenderEffectParameters.ParameterDeclare. Usually, the mapping is handled internally by a RenderEffectParameters class and thus hidden from client code. Shader resource objects are specified in a way similar to how constant data is specified: via a class type that is annotated with ShaderResources. Global configuration data may be specified via class types that are annotated with the Configuration attribute. Configuration data is compile-time constant and may thus be used to implement conditional compilation.

Public / Constants

CCW


public constant CCW → (0:int32)

A shared option value.

CW


public constant CW → (1:int32)

A shared option value.

EQUAL


public constant EQUAL → (2:int32)

A shared option value.

EVEN


public constant EVEN → (3:int32)

A shared option value.

ODD


public constant ODD → (5:int32)

A shared option value.

POINT


public constant POINT → (6:int32)

A shared option value.

QUAD


public constant QUAD → (7:int32)

A shared option value.

TRIANGLE


public constant TRIANGLE → (8:int32)

A shared option value.

Protected / Methods

abs


[Pure]
protected static method abs → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the absolute value of the given value (per component).

acos


[Pure]
protected static method acos → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the arc-cosine of the given value (per component).

asin


[Pure]
protected static method asin → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the arc-cosine of the given value (per component).

atan


[Pure]
protected static method atan → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the arc-tangent in the range [-pi/2..+pi/2] of the given value (per component).

atan2


[Pure]
protected static method atan2 → (2)<T val>

valueY in : T

The first input value.

valueX in : T

The second input value.

returns → T

The output value.

Computes the arc-tangent in the range [-pi..+pi] of the given value valueY in / valueX in (per component).

ceil


[Pure]
protected static method ceil → (1)<T val>

value in : T

The input value.

returns → T

The output value

Computes the smallest integral value that is greater than or equal to the given value (per component).

clamp


[Pure]
protected static method clamp → (3)<T val>

value in : T

The input value.

minimum in : T

The minimum bound (inclusive).

maximum in : T

The maximum bound (inclusive).

returns → T

The output value.

Clamps the given value to the specified bounds (per component).

cos


[Pure]
protected static method cos → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the cosine of the given value (per component).

cross


[Pure]
protected static method cross → (2)

vectorA in : float3

The first input vector.

vectorB in : float3

The second input vector.

returns → float3

The output value.

Computes the cross product of the given vectors.

ddx


[Pure]
protected static method ddx → (1)<T val>

value ref : T

The value.

returns → T

The partial derivative of value ref.

Computes the partial derivative of the given value, along the pixel X-axis (per component).

ddy


[Pure]
protected static method ddy → (1)<T val>

value ref : T

The value.

returns → T

The partial derivative of value ref.

Computes the partial derivative of the given value, along the pixel Y-axis (per component).

dot


[Pure]
protected static method dot → (2)<T val>

vectorA in : T

The first input vector.

vectorB in : T

The second input vector.

returns → float32

The output value.

Computes the dot product of the given vectors.

exp


[Pure]
protected static method exp → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the value of e raised by the given value (per component).

floor


[Pure]
protected static method floor → (1)<T val>

value in : T

The input value.

returns → T

The output value

Computes the greatest integral value that is less than or equal to the given value (per component).

fmod


[Pure]
protected static method fmod → (2)<T val>

dividend in : T

The dividend.

divisor in : T

The divisor.

returns → T

The remainder R, defined as a = i * b + R, where i is the integral number with the greatest absolute value for which a has the same sign as R.

Computes the remainder of the division of dividend in by divisor in (per component).

frac


[Pure]
protected static method frac → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the fractional part in the range [0..1[ of the given value (per component).

gx​Atomic​Add


protected static method gxAtomicAdd → (3)

variable ref : int32

The variable to update.

delta in : int32

The value to add to variable ref.

original out : int32

The value of variable ref before adding delta in.

Adds delta in to variable ref in an atomic operation.

gx​Discard


protected static method gxDiscard → ()

Discards the current pixel / fragment.

gx​Discard​If


protected static method gxDiscardIf → (1)

condition in : bool

The condition value.

Discards the current pixel / fragment if condition in is true.

gx​Discard​Negative


protected static method gxDiscardNegative → (1)

value in : float32

The condition value.

Discards the current pixel / fragment if value in is negative.

gx​Equal


[Pure]
protected static method gxEqual → (2)<T val>

in : T

The first input value.

in : T

The second input value.

returns → bool

true if the values are equal,
false if the values are different.

Checks if the given values are equal (per component).

gx​Face


[Pure]
protected static method gxFace → (1)

face in : FACE

The special FACE value.

returns → float32

+1 for a front-facing primitive,
-1 for a back-facing primitive.

Checks if the current primitive is front-facing or back-facing.

See also

PixelShader

gx​Size​Of


[Pure]
protected static method gxSizeOf → (2)<T val>

buffer in : TEXTURE_2D_RW<T>

The buffer.

size out : int2

The buffer width and height, in elements.

Returns the size of the given buffer.

gx​Size​Of​Level


[Pure]
protected static method gxSizeOfLevel → (3)<T val>

texture in : TEXTURE_CUBE<T>

The buffer.

level in : int32

The mipmap level.

size out : int32

The texture level size, in texels.

Returns the size of the given texture.

gx​Stream​Append


[Pure]
protected static method gxStreamAppend → (2)<T val>

stream in : STREAM<T>

The geometry stream.

value in : T

The vertex to append.

Appends a vertex to the given geometry stream.

gx​Stream​Reset


[Pure]
protected static method gxStreamReset → (1)<T val>

stream in : STREAM<T>

The geometry stream.

Starts a new primitive on the given geometry stream.

gx​Sync


protected static method gxSync → ()

Synchronizes execution of all threads in a group and issued a memory barrier.

See also

ComputeShader

gx​Texture2​D


[Pure]
protected static method gxTexture2D → (2)<T val>

texture in : TEXTURE_2D<T>

The texture to sample.

coords in : float2

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Texture2​DArray


[Pure]
protected static method gxTexture2DArray → (3)<T val>

texture in : TEXTURE_2D_ARRAY<T>

The texture to sample.

slice in : float32

The zero-based texture slice index.

coords in : float2

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Texture2​DArray​Lod


[Pure]
protected static method gxTexture2DArrayLod → (4)<T val>

texture in : TEXTURE_2D_ARRAY<T>

The texture to sample.

slice in : float32

The zero-based texture slice index.

coords in : float2

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​Texture2​DGet


[Pure]
protected static method gxTexture2DGet → (2)<T val>

texture in : TEXTURE_2D_RW<T>

The buffer resource.

xy in : int2

The element XY-indices.

returns → T

The element value.

Fetches an element of the given buffer.

gx​Texture2​DLod


[Pure]
protected static method gxTexture2DLod → (3)<T val>

texture in : TEXTURE_2D<T>

The texture to sample.

coords in : float2

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​Texture2​DSet


[Pure]
protected static method gxTexture2DSet → (3)<T val>

texture in : TEXTURE_2D_RW<T>

The buffer resource.

xy in : int2

The element XY-indices.

value in : T

The element value to store.

Stores an element in the given buffer.

gx​Texture​Cube


[Pure]
protected static method gxTextureCube → (2)<T val>

texture in : TEXTURE_CUBE<T>

The texture to sample.

coords in : float3

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Texture​Cube​Lod


[Pure]
protected static method gxTextureCubeLod → (3)<T val>

texture in : TEXTURE_CUBE<T>

The texture to sample.

coords in : float3

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures2​D


[Pure]
protected static method gxTextures2D → (3)<T val>

texture in : TEXTURE_2D<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

coords in : float2

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures2​DArray


[Pure]
protected static method gxTextures2DArray → (4)<T val>

texture in : TEXTURE_2D_ARRAY<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

slice in : float32

The zero-based texture slice index.

coords in : float2

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures2​DArray​Lod


[Pure]
protected static method gxTextures2DArrayLod → (5)<T val>

texture in : TEXTURE_2D_ARRAY<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

slice in : float32

The zero-based texture slice index.

coords in : float2

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures2​DLod


[Pure]
protected static method gxTextures2DLod → (4)<T val>

texture in : TEXTURE_2D<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

coords in : float2

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures​Cube


[Pure]
protected static method gxTexturesCube → (3)<T val>

texture in : TEXTURE_CUBE<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

coords in : float3

The texture coordinates.

returns → T

The texture sample.

Samples the given texture in.

gx​Textures​Cube​Lod


[Pure]
protected static method gxTexturesCubeLod → (4)<T val>

texture in : TEXTURE_CUBE<T> [ ]

The texture to sample.

index in : int32

Index into texture in.

coords in : float3

The texture coordinates.

lod in : float32

The level-of-detail, given as the zero-based mipmap level index.

returns → T

The texture sample.

Samples the given texture in.

gx​To​Float


[Pure]
protected static method gxToFloat → (1)

in : int32

The input value.

returns → float32

The output value.

Indicates that the given implicit value conversion is lossless.

gx​To​Float2

2 overloads


[Pure]
protected static method gxToFloat21 → (1)

in : float32

The input value.

returns → float2

The output value (x,x).

Performs a value conversion.


[Pure]
protected static method gxToFloat22 → (1)

in : int2

The input value.

returns → float2

The output value.

Performs a value conversion.

gx​To​Float2x2​Column​Major

2 overloads


[Pure]
protected static method gxToFloat2x2ColumnMajor1 → (2)

v1 in : float2

First column vector.

v2 in : float2

Second column vector.

returns → float2x2

The output 2x2 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat2x2ColumnMajor2 → (4)

m11 in : float32

First element of first column vector.

m21 in : float32

Second element of first column vector.

m12 in : float32

First element of second column vector.

m22 in : float32

Second element of second column vector.

returns → float2x2

The output 2x2 matrix value.

Performs a value conversion.

gx​To​Float2x2​Row​Major

2 overloads


[Pure]
protected static method gxToFloat2x2RowMajor1 → (2)

v1 in : float2

First row vector.

v2 in : float2

Second row vector.

returns → float2x2

The output 2x2 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat2x2RowMajor2 → (4)

m11 in : float32

First element of first row vector.

m12 in : float32

Second element of first row vector.

m21 in : float32

First element of second row vector.

m22 in : float32

Second element of second row vector.

returns → float2x2

The output 2x2 matrix value.

Performs a value conversion.

gx​To​Float3

2 overloads


[Pure]
protected static method gxToFloat31 → (1)

in : float32

The input value.

returns → float3

The output value (x,x,x).

Performs a value conversion.


[Pure]
protected static method gxToFloat32 → (1)

in : int3

The input value.

returns → float3

The output value.

Performs a value conversion.

gx​To​Float3x3​Column​Major

2 overloads


[Pure]
protected static method gxToFloat3x3ColumnMajor1 → (3)

v1 in : float3

First column vector.

v2 in : float3

Second column vector.

v3 in : float3

Third column vector.

returns → float3x3

The output 3x3 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat3x3ColumnMajor2 → (9)

m11 in : float32

First element of first column vector.

m21 in : float32

Second element of first column vector.

m31 in : float32

Third element of first column vector.

m12 in : float32

First element of second column vector.

m22 in : float32

Second element of second column vector.

m32 in : float32

Third element of second column vector.

m13 in : float32

First element of third column vector.

m23 in : float32

Second element of third column vector.

m33 in : float32

Third element of third column vector.

returns → float3x3

The output 3x3 matrix value.

Performs a value conversion.

gx​To​Float3x3​Row​Major

2 overloads


[Pure]
protected static method gxToFloat3x3RowMajor1 → (3)

v1 in : float3

First row vector.

v2 in : float3

Second row vector.

v3 in : float3

Third row vector.

returns → float3x3

The output 3x3 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat3x3RowMajor2 → (9)

m11 in : float32

First element of first row vector.

m12 in : float32

Second element of first row vector.

m13 in : float32

Third element of first row vector.

m21 in : float32

First element of second row vector.

m22 in : float32

Second element of second row vector.

m23 in : float32

Third element of second row vector.

m31 in : float32

First element of third row vector.

m32 in : float32

Second element of third row vector.

m33 in : float32

Third element of third row vector.

returns → float3x3

The output 3x3 matrix value.

Performs a value conversion.

gx​To​Float3x4​Column​Major

2 overloads


[Pure]
protected static method gxToFloat3x4ColumnMajor1 → (4)

v1 in : float3

First column vector.

v2 in : float3

Second column vector.

v3 in : float3

Third column vector.

v4 in : float3

Fourth column vector.

returns → float3x4

The output 3x4 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat3x4ColumnMajor2 → (12)

m11 in : float32

First element of first column vector.

m21 in : float32

Second element of first column vector.

m31 in : float32

Third element of first column vector.

m12 in : float32

First element of second column vector.

m22 in : float32

Second element of second column vector.

m32 in : float32

Third element of second column vector.

m13 in : float32

First element of third column vector.

m23 in : float32

Second element of third column vector.

m33 in : float32

Third element of third column vector.

m14 in : float32

First element of fourth column vector.

m24 in : float32

Second element of fourth column vector.

m34 in : float32

Third element of fourth column vector.

returns → float3x4

The output 3x4 matrix value.

Performs a value conversion.

gx​To​Float3x4​Row​Major

2 overloads


[Pure]
protected static method gxToFloat3x4RowMajor1 → (3)

v1 in : float4

First row vector.

v2 in : float4

Second row vector.

v3 in : float4

Third row vector.

returns → float3x4

The output 3x4 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat3x4RowMajor2 → (12)

m11 in : float32

First element of first row vector.

m12 in : float32

Second element of first row vector.

m13 in : float32

Third element of first row vector.

m14 in : float32

Fourth element of first row vector.

m21 in : float32

First element of second row vector.

m22 in : float32

Second element of second row vector.

m23 in : float32

Third element of second row vector.

m24 in : float32

Fourth element of second row vector.

m31 in : float32

First element of third row vector.

m32 in : float32

Second element of third row vector.

m33 in : float32

Third element of third row vector.

m34 in : float32

Fourth element of third row vector.

returns → float3x4

The output 3x4 matrix value.

Performs a value conversion.

gx​To​Float4

2 overloads


[Pure]
protected static method gxToFloat41 → (1)

in : float32

The input value.

returns → float4

The output value (x,x,x,x).

Performs a value conversion.


[Pure]
protected static method gxToFloat42 → (1)

in : int4

The input value.

returns → float4

The output value.

Performs a value conversion.

gx​To​Float4x4​Column​Major

2 overloads


[Pure]
protected static method gxToFloat4x4ColumnMajor1 → (4)

v1 in : float4

First column vector.

v2 in : float4

Second column vector.

v3 in : float4

Third column vector.

v4 in : float4

Fourth column vector.

returns → float4x4

The output 4x4 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat4x4ColumnMajor2 → (16)

m11 in : float32

First element of first column vector.

m21 in : float32

Second element of first column vector.

m31 in : float32

Third element of first column vector.

m41 in : float32

Fourth element of first column vector.

m12 in : float32

First element of second column vector.

m22 in : float32

Second element of second column vector.

m32 in : float32

Third element of second column vector.

m42 in : float32

Fourth element of second column vector.

m13 in : float32

First element of third column vector.

m23 in : float32

Second element of third column vector.

m33 in : float32

Third element of third column vector.

m43 in : float32

Fourth element of third column vector.

m14 in : float32

First element of fourth column vector.

m24 in : float32

Second element of fourth column vector.

m34 in : float32

Third element of fourth column vector.

m44 in : float32

Fourth element of fourth column vector.

returns → float4x4

The output 4x4 matrix value.

Performs a value conversion.

gx​To​Float4x4​Row​Major

2 overloads


[Pure]
protected static method gxToFloat4x4RowMajor1 → (4)

v1 in : float4

First row vector.

v2 in : float4

Second row vector.

v3 in : float4

Third row vector.

v4 in : float4

Fourth row vector.

returns → float4x4

The output 4x4 matrix value.

Performs a value conversion.


[Pure]
protected static method gxToFloat4x4RowMajor2 → (16)

m11 in : float32

First element of first row vector.

m12 in : float32

Second element of first row vector.

m13 in : float32

Third element of first row vector.

m14 in : float32

Fourth element of first row vector.

m21 in : float32

First element of second row vector.

m22 in : float32

Second element of second row vector.

m23 in : float32

Third element of second row vector.

m24 in : float32

Fourth element of second row vector.

m31 in : float32

First element of third row vector.

m32 in : float32

Second element of third row vector.

m33 in : float32

Third element of third row vector.

m34 in : float32

Fourth element of third row vector.

m41 in : float32

First element of fourth row vector.

m42 in : float32

Second element of fourth row vector.

m43 in : float32

Third element of fourth row vector.

m44 in : float32

Fourth element of fourth row vector.

returns → float4x4

The output 4x4 matrix value.

Performs a value conversion.

gx​To​Int2


[Pure]
protected static method gxToInt2 → (1)

in : int32

The input value.

returns → int2

The output value (x,x).

Performs a value conversion.

gx​To​Int3


[Pure]
protected static method gxToInt3 → (1)

in : int32

The input value.

returns → int3

The output value (x,x,x).

Performs a value conversion.

gx​To​Int4


[Pure]
protected static method gxToInt4 → (1)

in : int32

The input value.

returns → int4

The output value (x,x,x,x).

Performs a value conversion.

length


[Pure]
protected static method length → (1)<T val>

vector in : T

The input vector.

returns → float32

The length of vector in.

Returns the length of the given vector.

lerp


[Pure]
protected static method lerp → (3)<T val>

value0 in : T

The first input value.

value1 in : T

The second input value.

factor in : T

The interpolation factor: 0 maps to value0 in, 1 maps to value1 in.

returns → T

The output value.

Linearly interpolates between the given values (per component).

log


[Pure]
protected static method log → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the natural logarithm of the given value (per component).

log2


[Pure]
protected static method log2 → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the logarithm of base 2 of the given value (per component).

max


[Pure]
protected static method max → (2)<T val>

in : T

The first input value.

in : T

The second input value.

returns → T

The output value.

Computes the maximum of the given values (per component).

min


[Pure]
protected static method min → (2)<T val>

in : T

The first input value.

in : T

The second input value.

returns → T

The output value.

Computes the minimum of the given values (per component).

mul

7 overloads


[Pure]
protected static method mul1 → (2)

in : float2x2

The matrix.

in : float2

The column-vector.

returns → float2

The resulting column-vector.

Multiplies the given matrix and column-vector.

This is the standard form of a multiplication of a matrix and a vector:

| m11 m12 |   | x |   | m11 * x + m12 * y |
| m21 m22 | * | y | = | m21 * x + m22 * y |

[Pure]
protected static method mul2 → (2)

in : float3x3

The matrix.

in : float3

The column-vector.

returns → float3

The resulting column-vector.

Multiplies the given matrix and column-vector.

This is the standard form of a multiplication of a matrix and a vector:

| m11 m12 m13 |   | x |   | m11 * x + m12 * y + m13 * z |
| m21 m22 m23 | * | y | = | m21 * x + m22 * y + m23 * z |
| m31 m32 m33 |   | z |   | m31 * x + m32 * y + m33 * z |

[Pure]
protected static method mul3 → (2)

in : float3x4

The matrix.

in : float4

The column-vector.

returns → float3

The resulting column-vector.

Multiplies the given matrix and column-vector.

This is the standard form of a multiplication of a matrix and a vector:

| m11 m12 m13 m14 |   | x |   | m11 * x + m12 * y + m13 * z + m14 * w |
| m21 m22 m23 m24 | * | y | = | m21 * x + m22 * y + m23 * z + m24 * w |
| m31 m32 m33 m34 |   | z |   | m31 * x + m32 * y + m33 * z + m34 * w |

[Pure]
protected static method mul4 → (2)

in : float4x4

The matrix.

in : float4

The column-vector.

returns → float4

The resulting column-vector.

Multiplies the given matrix and column-vector.

This is the standard form of a multiplication of a matrix and a vector:

| m11 m12 m13 m14 |   | x |   | m11 * x + m12 * y + m13 * z + m14 * w |
| m21 m22 m23 m24 | * | y | = | m21 * x + m22 * y + m23 * z + m24 * w |
| m31 m32 m33 m34 |   | z |   | m31 * x + m32 * y + m33 * z + m34 * w |
| m41 m42 m43 m44 |   | w |   | m41 * x + m42 * y + m43 * z + m44 * w |

[Pure]
protected static method mul5 → (2)

in : float2

The row-vector.

in : float2x2

The matrix.

returns → float2

The resulting row-vector.

Multiplies the given row-vector and matrix.

This is the transposed form of a multiplication of a matrix and a vector:

| x |T    | m11 m12 |   | m11 * x + m21 * y |T
| y |  *  | m21 m22 | = | m12 * x + m22 * y |

Calling mul2 with the transpose of in yields the same result.


[Pure]
protected static method mul6 → (2)

in : float3

The row-vector.

in : float3x3

The matrix.

returns → float3

The resulting row-vector.

Multiplies the given row-vector and matrix.

This is the transposed form of a multiplication of a matrix and a vector:

| x |T    | m11 m12 m13 |   | m11 * x + m21 * y + m31 * z |T
| y |  *  | m21 m22 m23 | = | m12 * x + m22 * y + m32 * z |
| z |     | m31 m32 m33 |   | m13 * x + m23 * y + m32 * z |

Calling mul2 with the transpose of in yields the same result.


[Pure]
protected static method mul7 → (2)

in : float4

The row-vector.

in : float4x4

The matrix.

returns → float4

The resulting row-vector.

Multiplies the given row-vector and matrix.

This is the transposed form of a multiplication of a matrix and a vector:

| x |T    | m11 m12 m13 m14 |   | m11 * x + m21 * y + m31 * z + m41 * w |T
| y |  *  | m21 m22 m23 m24 | = | m12 * x + m22 * y + m32 * z + m42 * w |
| z |     | m31 m32 m33 m34 |   | m13 * x + m23 * y + m32 * z + m43 * w |
| w |     | m41 m42 m43 m44 |   | m14 * x + m24 * y + m33 * z + m44 * w |

Calling mul4 with the transpose of in yields the same result.

normalize


[Pure]
protected static method normalize → (1)<T val>

vector in : T

The input vector.

returns → T

The output vector.

Normalizes the given vector to unit-length.

pow


[Pure]
protected static method pow → (2)<T val>

value in : T

The value to raise by power in.

power in : T

The power to raise value in by.

returns → T

The output scalar or vector.

Computes the specified value raised to the specified power (per component).

reflect


[Pure]
protected static method reflect → (2)

in : float3

The incident ray.

in : float3

The surface normal.

returns → float3

The reflection vector.

Computes a reflection vector using an incident ray and a surface normal:

result := i - n * 2 * dot(i, n)

round


[Pure]
protected static method round → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Rounds the specified value to the nearest integer (per component).

saturate


[Pure]
protected static method saturate → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Clamps the given value to the range [0..1] (per component).

sign


[Pure]
protected static method sign → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes -1, 0 or +1, depending on whether the given value is less than zero, equal to zero or greater than zero (per component).

sin


[Pure]
protected static method sin → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the sine of the given value (per component).

smoothstep


[Pure]
protected static method smoothstep → (3)<T val>

value0 in : T

The input value to map to the output factor 0.

value1 in : T

The input value to map to the output factor 1.

value in : T

The input value.

returns → T

The output factor in the range [0..1].

Computes a smooth output factor in the range [0..1], when the given input value in is within in the range [value0 in.. value1 in] (per component).

sqrt


[Pure]
protected static method sqrt → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the square root of the given value (per component).

tan


[Pure]
protected static method tan → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Computes the tangent of the given value (per component).

transpose


[Pure]
protected static method transpose → (1)<T val>

matrix in : T

The input matrix.

returns → T

The transpose of matrix in.

Returns the transpose of the given square matrix.

trunc


[Pure]
protected static method trunc → (1)<T val>

value in : T

The input value.

returns → T

The output value.

Truncates the given value to its integral part (per component).