Class LatticePluginMaterial
Hierarchy (View Summary)
- WebXRSpatialLayerType
- LatticePluginMaterial
Constructors
constructor
-
Create a new LatticePluginMaterial
Parameters
- lattice: Lattice
defines the lattice this plugin is associated with
- material: Material
defines the material this plugin is associated with
Returns LatticePluginMaterial
- lattice: Lattice
Methods
bind For Sub Mesh
-
Binds the material data.
Parameters
- uniformBuffer: UniformBuffer
defines the Uniform buffer to fill in.
Returns void
- uniformBuffer: UniformBuffer
dispose
-
Disposes the resources of the material.
Returns void
get Class Name
-
Get the class name of the plugin
Returns string
the string "LatticePluginMaterial"
get Custom Code
-
getCustomCode(
shaderType: string,
shaderLanguage?: any,
):
| {
CUSTOM_VERTEX_DEFINITIONS: string;
CUSTOM_VERTEX_UPDATE_POSITION: string;
}
| nullReturns a list of custom shader code fragments to customize the shader.
Parameters
- shaderType: string
"vertex" or "fragment"
- shaderLanguage: any = ShaderLanguage.GLSL
The shader language to use.
Returns
| {
CUSTOM_VERTEX_DEFINITIONS: string;
CUSTOM_VERTEX_UPDATE_POSITION: string;
}
| nullnull if no code to be added, or a list of pointName => code.
- 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 Uniforms
-
getUniforms(
shaderLanguage?: ShaderLanguage,
): {
fragment?: string;
ubo: { arraySize?: number; name: string; size: number; type: string }[];
vertex?: string;
}Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)
Parameters
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
The shader language to use.
Returns {
fragment?: string;
ubo: { arraySize?: number; name: string; size: number; type: string }[];
vertex?: string;
}the description of the uniforms
- shaderLanguage: ShaderLanguage = ShaderLanguage.GLSL
is Compatible
-
Defines if the plugin supports the specified shader language
Parameters
- shaderLanguage: ShaderLanguage
defines the shader language to check
Returns boolean
true if supported, false otherwise
- shaderLanguage: ShaderLanguage
refresh Data
-
Must be called when the lattice data was updated
Returns void
Material plugin to add hardware accelerated lattice support
See