Header menu logo Mibo

LitShader Module

Embedded GLSL shaders for the built-in lit-sprite pipeline with SDF shadow raymarching.

Functions and values

Function or value Description

fragmentSource

Full Usage: fragmentSource

Returns: string
Returns: string

fragmentSourceNormalMap

Full Usage: fragmentSourceNormalMap

Returns: string

Fragment shader variant for normal-mapped sprites. Uses a 2D-compatible Half-Lambert lighting model where NdotL = max(1.0 + dot(normal.xy, L), 0.0), so flat normals produce the same result as the non-NM shader while the normal map's XY perturbation adds directional variation.

Returns: string

load ()

Full Usage: load ()

Parameters:
    () : unit

Returns: Shader

Loads the built-in lit-sprite shader from embedded GLSL sources.

() : unit
Returns: Shader

loadNormalMap ()

Full Usage: loadNormalMap ()

Parameters:
    () : unit

Returns: Shader

Loads the normal-mapped lit-sprite shader from embedded GLSL sources.

() : unit
Returns: Shader

vertexSource

Full Usage: vertexSource

Returns: string
Returns: string

Type something to start searching.