Inheritance: EventDispatcher →
A class for managing multiple uniforms in a single group. The renderer will process such a definition as a single UBO.
Since this class can only be used in context of ShaderMaterial, it is only supported in WebGLRenderer.
Constructs a new uniforms group.
A Float32 array buffer with the uniform values.
Overrides: UniformBuffer#buffer
The byte length of the buffer with correct buffer alignment.
Overrides: UniformBuffer#byteLength
The ID of the 3D object.
This flag can be used for type testing.
Default is true.
This flag can be used for type testing.
Default is true.
The name of the uniforms group.
Overrides: UniformBuffer#name
An array holding the uniforms.
An array of uniform objects.
The order of uniforms in this array must match the order of uniforms in the shader.
The buffer usage.
Default is StaticDrawUsage.
An array with the raw uniform values.
Adds the given uniform to this uniforms group.
uniform
The uniform to add.
Returns: A reference to this uniforms group.
Adds a uniform to this group.
uniform
The uniform to add.
Returns: A reference to this group.
Adds a uniform's update range to this buffer.
uniform
The uniform.
Clears all update ranges of this buffer.
Overrides: UniformBuffer#clearUpdateRanges
Returns a new uniforms group with copied values from this instance.
Overrides: UniformBuffer#clone
Returns: A clone of this instance.
Copies the values of the given uniforms group to this instance.
source
The uniforms group to copy.
Returns: A reference to this uniforms group.
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
Removes the given uniform from this uniforms group.
uniform
The uniform to remove.
Returns: A reference to this uniforms group.
Removes a uniform from this group.
uniform
The uniform to remove.
Returns: A reference to this group.
Sets the name of this uniforms group.
name
The name to set.
Returns: A reference to this uniforms group.
Sets the usage of this uniforms group.
value
The usage to set.
Returns: A reference to this uniforms group.
Updates this group by updating each uniform object of the internal uniform list. The uniform objects check if their values has actually changed so this method only returns true if there is a real value change.
Overrides: UniformBuffer#update
Returns: Whether the uniforms have been updated and must be uploaded to the GPU.
Updates a given uniform by calling an update method matching the uniforms type.
uniform
The uniform to update.
Returns: Whether the uniform has been updated or not.
Updates a given Color uniform.
uniform
The Color uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Matrix3 uniform.
uniform
The Matrix3 uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Matrix4 uniform.
uniform
The Matrix4 uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Number uniform.
uniform
The Number uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Vector2 uniform.
uniform
The Vector2 uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Vector3 uniform.
uniform
The Vector3 uniform.
Returns: Whether the uniform has been updated or not.
Updates a given Vector4 uniform.
uniform
The Vector4 uniform.
Returns: Whether the uniform has been updated or not.