override-shader-chunks
Override shading through chunks
A StandardMaterial's shader is assembled from named chunks (lighting, combine, transform, and
more). Overriding one keeps the rest of the pipeline — fog, tonemapping, shadows, skinning,
instancing — intact. Reach for a fully custom ShaderMaterial only when the look needs a stage the
chunk system does not expose at all (its own vertex/fragment pair and attribute layout); a chunk
override is the default for everything else, since it is cheaper and stays integrated.
Pin the version, read the source
Set material.shaderChunksVersion to the installed engine's major.minor (for example '2.22')
before shipping any override. Chunk names and their contracts — what a chunk defines, what globals
it reads or writes — are version-keyed and change between releases. Read the installed playcanvas
source for the exact chunk being touched; do not recall its contract from memory or an older
version's documentation.