The WebGLRenderer that owns this ShaderProgramFactory.
A map of shader programs, identified by a unique key.
The key of each shader program is made up of the following components:
The WebGLRenderer that owns this ShaderProgramFactory.
Creates a shader program based on the given configuration settings.
The unique key of the shader program.
The base shader configuration.
Optionaladditions: ShaderAdditionConfig[]
An array of shader addition configurations.
Optionalfeatures: string[]
An array of enabled shader feature keys.
The newly compiled and cached shader program wrapper.
Returns a unique key for a shader program based on the given configuration settings.
The key is made up of the following components:
The base shader configuration.
Optionaladditions: ShaderAdditionConfig[]
An array of shader addition configurations.
Optionalfeatures: string[]
An array of enabled shader feature keys.
The unique cache key for this shader configuration.
Returns a compiled shader program for the given configuration. If a program matching the derived key already exists in the cache it is returned immediately; otherwise a new program is compiled, stored in the cache, and returned.
The base shader configuration.
Optionaladditions: ShaderAdditionConfig[]
An array of shader addition configurations.
Optionalfeatures: string[]
An array of enabled shader feature keys.
The compiled shader program wrapper.
Checks whether a compiled shader program with the given key already exists in the internal cache.
The unique key of the shader program.
true if a shader program with this key exists in the cache, otherwise false.
The ShaderProgramFactory is a utility class used to create and cache Phaser.Renderer.WebGL.Wrappers.WebGLProgramWrapper objects for the WebGL renderer. It assembles compiled shader programs from a base shader combined with optional additions and feature flags, then stores the result under a unique key so that the same combination is never compiled more than once. Use this class when you need to obtain a shader program that may vary at runtime based on renderer capabilities or pipeline configuration.