Advanced
Create a new Uniform group
The structures of the uniform group
Optional
options: UniformGroupOptionsThe optional parameters of this uniform group
Optional
bufferan underlying buffer that will be uploaded to the GPU when using this UniformGroup
if true, then you are responsible for when the data is uploaded to the GPU. otherwise, the data is reuploaded each frame.
Readonly
isused ito identify if this is a uniform group
true if it should be used as a uniform buffer object
Readonly
uida unique id for this uniform group used through the renderer
the uniforms as an easily accessible map of properties
the structures of the uniform group
Static
defaultThe default options used by the uniform group.
Uniform group holds uniform map and some ID's for work
UniformGroup
has two modes:1: Normal mode Normal mode will upload the uniforms with individual function calls as required. This is the default mode for WebGL rendering.
2: Uniform buffer mode This mode will treat the uniforms as a uniform buffer. You can pass in either a buffer that you manually handle, or or a generic object that PixiJS will automatically map to a buffer for you. For maximum benefits, make Ubo UniformGroups static, and only update them each frame. This is the only way uniforms can be used with WebGPU.
Rules of UBOs:
When declaring your uniform options, you ust parse in the value and the type of the uniform. The types correspond to the WebGPU types
Uniforms can be modified via the classes 'uniforms' property. It will contain all the uniforms declared in the constructor.