Class CustomMaterial
Hierarchy (View Summary)
- WebXRSpatialLayerType
- CustomMaterial
Index
Constructors
Properties
Methods
Constructors
constructor
-
Parameters
- name: string
Optionalscene: any
Returns CustomMaterial
Properties
_ created Shader Name
Name of the shader
_ custom Attributes
List of the custom attributes
_ custom Uniform
List of custom uniforms
_ new Sampler Instances
Instances of the new sampler objects
_ new Uniform Instances
Instances of the new uniform objects
_ new Uniforms
Names of the new uniforms
Custom Parts
Custom shader structure
Fragment Shader
Fragment shader string
Vertex Shader
Vertex shader string
StaticShader Indexer
Index for each created shader
Methods
Add Attribute
-
Adds a custom attribute
Parameters
- name: string
the name of the attribute
Returns CustomMaterial
the current material
- name: string
Add Uniform
-
Adds a new uniform to the shader
Parameters
- name: string
the name of the uniform to add
- kind: string
the type of the uniform to add
- param: any
the value of the uniform to add
Returns CustomMaterial
the current material
- name: string
Attach After Bind
-
Runs after the material is bound to a mesh
Parameters
- mesh: any
mesh bound
- effect: Effect
bound effect used to render
Returns void
- mesh: any
Builder
-
Builder(
shaderName: string,
uniforms: string[],
uniformBuffers: string[],
samplers: string[],
defines: any,
attributes?: string[],
): stringBuilds the material
Parameters
- shaderName: string
name of the shader
- uniforms: string[]
list of uniforms
- uniformBuffers: string[]
list of uniform buffers
- samplers: string[]
list of samplers
- defines: any
list of defines
Optionalattributes: string[]list of attributes
Returns string
the shader name
- shaderName: string
Fragment_ Before_ Fog
-
Sets the code on Fragment_Before_Fog portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Before_ Frag Color
-
Sets the code on Fragment_Before_FragColor portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Before_ Lights
-
Sets the code on Fragment_Before_Lights portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Begin
-
Sets the code on Fragment_Begin portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Custom_ Alpha
-
Sets the code on Fragment_Custom_Alpha portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Custom_ Diffuse
-
Sets the code on Fragment_Custom_Diffuse portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Definitions
-
Sets the code on Fragment_Definitions portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Main Begin
-
Sets the code on Fragment_MainBegin portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Fragment_ Main End
-
Sets the code on Fragment_MainEnd portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ After_ World Pos Computed
-
Sets the code on Vertex_After_WorldPosComputed portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Before_ Normal Updated
-
Sets the code on Vertex_Before_NormalUpdated portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Before_ Position Updated
-
Sets the code on Vertex_Before_PositionUpdated portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Begin
-
Sets the code on Vertex_Begin portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Definitions
-
Sets the code on Vertex_Definitions portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Main Begin
-
Sets the code on Vertex_MainBegin portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Vertex_ Main End
-
Sets the code on Vertex_MainEnd portion
Parameters
- shaderPart: string
the code string
Returns CustomMaterial
the current material
- shaderPart: string
Customized material