shader
Last updated
Last updated
This type represents a shader.
Rendering system uses Shader Version 4 (ps_4_0).
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:
Constructs a shader.
Arguments
Name
Type
Description
src
string
Shader source code.
Returns
Type
Description
shader
Shader object.
Example