Class GaussianSplattingSolidColorMaterialPlugin
Hierarchy (View Summary)
- MaterialPluginBase
- GaussianSplattingSolidColorMaterialPlugin
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new GaussianSplattingSolidColorMaterialPlugin(
material: GaussianSplattingMaterial,
partColors: Color3[],
maxPartCount?: number,
): GaussianSplattingSolidColorMaterialPluginCreates a new GaussianSplatSolidColorPlugin.
Parameters
- material: GaussianSplattingMaterial
The GaussianSplattingMaterial to attach the plugin to.
- partColors: Color3[]
A map from part index to the solid Color3 for that part.
OptionalmaxPartCount: numberThe maximum number of parts supported. This determines the size of the uniform array.
Returns GaussianSplattingSolidColorMaterialPlugin
- material: GaussianSplattingMaterial
Properties
do Not Serialize
Specifies if the material plugin should be serialized, true to skip serialization
Readonlymark All Defines As Dirty
Helper function to mark defines as being dirty.
name
Defines the name of the plugin
priority
Defines the priority of the plugin. Lower numbers run first.
register For Extra Events
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
resolve Includes
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
Accessors
is Enabled
-
get isEnabled(): boolean
Whether the solid-color override is active. When false, splats render with their original per-splat colors. Toggled via a shader uniform so no recompilation is required.
Returns boolean
-
set isEnabled(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
add Fallbacks
-
Add fallbacks to the effect fallbacks list.
Parameters
- defines: MaterialDefines
defines the Base texture to use.
- fallbacks: EffectFallbacks
defines the current fallback list.
- currentRank: number
defines the current fallback rank.
Returns number
the new fallback rank.
- defines: MaterialDefines
bind For Sub Mesh
-
bindForSubMesh(
_uniformBuffer: UniformBuffer,
_scene: Scene,
_engine: AbstractEngine,
subMesh: SubMesh,
): voidBinds the plugin uniforms each frame.
Parameters
- _uniformBuffer: UniformBuffer
the uniform buffer (unused — we bind directly on the effect)
- _scene: Scene
the current scene
- _engine: AbstractEngine
the current engine
- subMesh: SubMesh
the submesh being rendered
Returns void
- _uniformBuffer: UniformBuffer
collect Defines
-
Collects all defines.
Parameters
- defines: { [name: string]: { default: any; type: string } }
The object to append to.
Returns void
- defines: { [name: string]: { default: any; type: string } }
copy To
-
Makes a duplicate of the current configuration into another one.
Parameters
- plugin: MaterialPluginBase
define the config where to copy the info
Returns void
- plugin: MaterialPluginBase
dispose
-
Disposes the resources of the material.
Parameters
Optional_forceDisposeTextures: booleanForces the disposal of all textures.
Returns void
fill Render Target Textures
-
Fills the list of render target textures.
Parameters
- _renderTargets: SmartArray<RenderTargetTexture>
the list of render targets to update
Returns void
- _renderTargets: SmartArray<RenderTargetTexture>
get Active Textures
-
Returns an array of the actively used textures.
Parameters
- _activeTextures: BaseTexture[]
Array of BaseTextures
Returns void
- _activeTextures: BaseTexture[]
get Animatables
-
Returns the animatable textures.
Parameters
- _animatables: IAnimatable[]
Array of animatable textures.
Returns void
- _animatables: IAnimatable[]
get Attributes
-
Gets the attributes used by the plugin.
Parameters
- _attributes: string[]
list that the attribute names should be added to.
- _scene: Scene
the scene that the material belongs to.
- _mesh: AbstractMesh
the mesh being rendered.
Returns void
- _attributes: string[]
get Class Name
-
Returns string
the class name
get Custom Code
-
getCustomCode(
shaderType: string,
shaderLanguage?: ShaderLanguage,
): Nullable<{ [pointName: string]: string }>Returns custom shader code fragments to inject solid-color rendering.
Parameters
- shaderType: string
"vertex" or "fragment"
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
the shader language to use (default: GLSL)
Returns Nullable<{ [pointName: string]: string }>
null or a map of injection point names to code strings
- shaderType: string
get Samplers
-
Gets the samplers used by the plugin.
Parameters
- _samplers: string[]
list that the sampler names should be added to.
Returns void
- _samplers: string[]
get Uniform Buffers Names
-
Gets the uniform buffers names added by the plugin.
Parameters
- _ubos: string[]
list that the ubo names should be added to.
Returns void
- _ubos: string[]
get Uniforms
-
getUniforms(): {
externalUniforms?: string[];
fragment?: string;
ubo?: { arraySize?: number; name: string; size?: number; type?: string }[];
vertex?: string;
}Registers the plugin uniforms with the engine so that the Effect can resolve their locations.
Returns {
externalUniforms?: string[];
fragment?: string;
ubo?: { arraySize?: number; name: string; size?: number; type?: string }[];
vertex?: string;
}uniform descriptions
hard Bind For Sub Mesh
-
hardBindForSubMesh(
_uniformBuffer: UniformBuffer,
_scene: Scene,
_engine: AbstractEngine,
_subMesh: SubMesh,
): voidBinds the material data (this function is called even if mustRebind() returns false)
Parameters
- _uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
- _scene: Scene
defines the scene the material belongs to.
- _engine: AbstractEngine
defines the engine the material belongs to.
- _subMesh: SubMesh
the submesh to bind data for
Returns void
- _uniformBuffer: UniformBuffer
has Render Target Textures
-
Gets a boolean indicating that current material needs to register RTT
Returns boolean
true if this uses a render target otherwise false.
has Texture
-
Checks to see if a texture is used in the material.
Parameters
- _texture: BaseTexture
Base texture to use.
Returns boolean
- Boolean specifying if a texture is used in the material.
- _texture: BaseTexture
is Compatible
-
Indicates this plugin supports both GLSL and WGSL.
Parameters
- shaderLanguage: ShaderLanguage
the shader language to check
Returns boolean
true for GLSL and WGSL
- shaderLanguage: ShaderLanguage
is Ready For Sub Mesh
-
isReadyForSubMesh(
_defines: MaterialDefines,
_scene: Scene,
_engine: AbstractEngine,
_subMesh: SubMesh,
): booleanAlways ready — no textures or async resources to wait on.
Parameters
- _defines: MaterialDefines
the defines
- _scene: Scene
the scene
- _engine: AbstractEngine
the engine
- _subMesh: SubMesh
the submesh
Returns boolean
true
- _defines: MaterialDefines
parse
-
Parses a plugin configuration from a serialized object.
Parameters
- source: any
Serialized object.
- scene: Scene
Defines the scene we are parsing for
- rootUrl: string
Defines the rootUrl to load from
Returns void
- source: any
prepare Defines
-
Sets the defines for the next rendering
Parameters
- _defines: MaterialDefines
the list of "defines" to update.
- _scene: Scene
defines the scene to the material belongs to.
- _mesh: AbstractMesh
the mesh being rendered
Returns void
- _defines: MaterialDefines
prepare Defines Before Attributes
-
prepareDefinesBeforeAttributes(
_defines: MaterialDefines,
_scene: Scene,
_mesh: AbstractMesh,
): voidSets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.
Parameters
- _defines: MaterialDefines
the list of "defines" to update.
- _scene: Scene
defines the scene to the material belongs to.
- _mesh: AbstractMesh
the mesh being rendered
Returns void
- _defines: MaterialDefines
serialize
-
Serializes this plugin configuration.
Returns any
- An object with the serialized config.
update Part Colors
-
Updates the part colors dynamically.
Parameters
- partColors: Color3[]
A map from part index to the solid Color3 for that part.
Returns void
- partColors: Color3[]
Plugin for GaussianSplattingMaterial that replaces per-splat colors with a solid color per compound-mesh part. Each part index maps to a single Color3 value, which is looked up in a uniform array in the fragment shader.