Creation

Material Shaders are a powerful way of controlling the artistic beauty of your game's environment, but can also be a cost to performance, game size and load times if abused. A balance of efficient shader code and reusing parameters is how you can reduce the overall load of the renderer, allow better draw batching, as well as reduce shader compilation times and file sizes!

Domain

Material Shaders have several domains, each with a different underlying purpose:

Surface Pipeline Signature

Render Pass

Pass Mode

Controls which pass the material shader will be rendered in. This will have an influence on the possible features that this shader may access.

Options:

Shading

Lighting Model

Controls how the material will be shaded, and enables usage of certain material parameters.

Options:

Blend State

Blend Mode

Changes how the material's output colour is combined with the colours already present in the background render target.

Options:

Alpha Cutoff

Determines the threshold value at which pixels are completely discarded (clipped) when rendering. Any alpha value below this threshold will not be drawn, resulting in sharp, hard edges instead of smooth gradients.

Note: Only active when Blend Mode is set to 'Alpha Clip'.

Draw Order Hint

Provides a manual sorting priority offset for transparent or overlapping objects. This is useful for resolving depth sorting artifacts where the engine struggles to automatically determine which transparent material should render in front of another.

Rasteriser State

Polygon Mode

Defines how the rasteriser translates the geometry's vertices into pixels on the screen. Usually modified for debugging purposes or specific stylistic wireframe effects.

Options:

Culling

Determines which faces of a polygon are discarded (culled) based on their normal direction relative to the camera. This optimises performance by skipping faces that point away from the viewer. Assumed winding order is Clockwise.

Options:

Depth State

Depth Modify

Allows modification of depth values through Pixel Depth Offset. Note that the pixel depth is Reverse Z, meaning negative values move further away from the camera. Note that on pass mode Opaque G-Buffer this can visually alter lighting information, as position information is inferred from depth.

Options:

Geometry Manipulation

Vertex Offset Mode

Allows modification of vertex positions, and that the node either designates local or world offset. Note that Local offset is post-skinning! This is due to vertex transform caching for improved efficiency!

Options:

Tessellation Mode

Enables subdivision of vertices for improved geometry quality. Note that performance may significantly degrade with this rendering feature! Please use with caution! Consider using more subdivided meshes instead.

Options:

Tessellation Partitioning

Controls how the tessellation factors are interpreted when dividing an edge, dictating how new vertices are introduced and how smoothly geometry transitions between different levels of detail.

Options:

Note: Only active when Tessellation Mode is not set to 'No Tessellation'.

Multi Sample State

MSAA Mode

Enhance quality through MSAA usage. Only supported on Forward render modes.

Options:

Note: Only active when Pass Mode is set to 'Forward No Early Z'.

Render Systems

Renderer Features

Supported Geometry

Decal Pipeline Signature

Volumetric Pipeline Signature

Post Processing Pipeline Signature

RML Pipeline Signature

Brush Pipeline Signature

Input Parameters

To allow reusing shaders across multiple materials, input parameters are a powerful way of sending data to the GPU.

Shader Editor

Material Shaders are written by method of visual nodes. This is a restriction imposed to optimise shader permutation.