🖼️shader

This type represents a shader. HLSL documentationarrow-up-right

circle-info

This type inherits managed type. All of its base methods and fields are also available in this type.

circle-info

Only fragment shaders (aka Pixel Shaders) are supported.

circle-check

HLSL structures

The constant buffer fields are the following:

Name

Type

Description

mvp

float4x4

Projection matrix.

tex

float2

Texture dimensions.

time

float

Render time (NOT the frame time).

alpha

float

Global opacity override.

The input fields are the following:

Name

Type

Description

pos

float4

Vertex position on screen (x,y,z over w). Register: SV_POSITION.

col

float4

Vertex color tint (r, g, b, a). Register: COLOR0.

uv

float2

UV coordinates (u, v). Register: TEXCOORD0.

The bound objects are the following:

Name

Type

Description

sampler0

sampler

Texture sampler.

texture0

Texture2D

Texture object.

Template:


__call

Constructor

Constructs a shader.

Arguments

Name

Type

Description

src

string

Shader source code.

Returns

Type

Description

shader

Shader object.

Example

Last updated