five-on-it / apps/client/src/renderer/level-batches / BatchSurfacePlugin
Class: BatchSurfacePlugin
Defined in: apps/client/src/renderer/level-batches.ts:95
The batches' shader: the vertex's colour is the diffuse colour (where Babylon would multiply the lit colour by it, which clamps a sunlit face differently), wetted (wet, a factor) and snowed over (snow, toward snowColor) as weather-view.ts asks.
Extends
MaterialPluginBase
Constructors
Constructor
new BatchSurfacePlugin(
material):BatchSurfacePlugin
Defined in: apps/client/src/renderer/level-batches.ts:103
Parameters
material
Material
Returns
BatchSurfacePlugin
Overrides
MaterialPluginBase.constructor
Properties
_material
protected_material:Material
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:42
Inherited from
MaterialPluginBase._material
_pluginDefineNames?
protectedoptional_pluginDefineNames?:object
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:44
Index Signature
[name: string]: any
Inherited from
MaterialPluginBase._pluginDefineNames
_pluginManager
protected_pluginManager:MaterialPluginManager
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:43
Inherited from
MaterialPluginBase._pluginManager
doNotSerialize
doNotSerialize:
boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:41
Specifies if the material plugin should be serialized, true to skip serialization
Inherited from
MaterialPluginBase.doNotSerialize
markAllDefinesAsDirty
readonlymarkAllDefinesAsDirty: () =>void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:57
Helper function to mark defines as being dirty.
Returns
void
Inherited from
MaterialPluginBase.markAllDefinesAsDirty
name
name:
string
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:25
Defines the name of the plugin
Inherited from
MaterialPluginBase.name
priority
priority:
number
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:29
Defines the priority of the plugin. Lower numbers run first.
Inherited from
MaterialPluginBase.priority
registerForExtraEvents
registerForExtraEvents:
boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:37
Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)
Inherited from
MaterialPluginBase.registerForExtraEvents
resolveIncludes
resolveIncludes:
boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:33
Indicates that any #include directive in the plugin code must be replaced by the corresponding code.
Inherited from
MaterialPluginBase.resolveIncludes
snow
snow:
number=0
Defined in: apps/client/src/renderer/level-batches.ts:99
How far the snow covers it (0 none).
snowColor
readonlysnowColor:Color3
Defined in: apps/client/src/renderer/level-batches.ts:101
The snow's colour.
wet
wet:
number=1
Defined in: apps/client/src/renderer/level-batches.ts:97
How dark the wet makes the colour (1 dry).
Methods
_enable()
protected_enable(enable):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:53
Parameters
enable
boolean
Returns
void
Inherited from
MaterialPluginBase._enable
addFallbacks()
addFallbacks(
defines,fallbacks,currentRank):number
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:175
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.
Inherited from
MaterialPluginBase.addFallbacks
bindForSubMesh()
bindForSubMesh(
uniformBuffer):void
Defined in: apps/client/src/renderer/level-batches.ts:125
Binds the material data.
Parameters
uniformBuffer
UniformBuffer
Returns
void
Overrides
MaterialPluginBase.bindForSubMesh
collectDefines()
collectDefines(
defines):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:122
Collects all defines.
Parameters
defines
The object to append to.
Returns
void
Inherited from
MaterialPluginBase.collectDefines
copyTo()
copyTo(
plugin):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:213
Makes a duplicate of the current configuration into another one.
Parameters
plugin
MaterialPluginBase
define the config where to copy the info
Returns
void
Inherited from
MaterialPluginBase.copyTo
dispose()
dispose(
_forceDisposeTextures?):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:105
Disposes the resources of the material.
Parameters
_forceDisposeTextures?
boolean
Forces the disposal of all textures.
Returns
void
Inherited from
MaterialPluginBase.dispose
fillRenderTargetTextures()
fillRenderTargetTextures(
_renderTargets):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:157
Fills the list of render target textures.
Parameters
_renderTargets
SmartArray<RenderTargetTexture>
the list of render targets to update
Returns
void
Inherited from
MaterialPluginBase.fillRenderTargetTextures
getActiveTextures()
getActiveTextures(
_activeTextures):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:162
Returns an array of the actively used textures.
Parameters
_activeTextures
BaseTexture[]
Array of BaseTextures
Returns
void
Inherited from
MaterialPluginBase.getActiveTextures
getAnimatables()
getAnimatables(
_animatables):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:167
Returns the animatable textures.
Parameters
_animatables
IAnimatable[]
Array of animatable textures.
Returns
void
Inherited from
MaterialPluginBase.getAnimatables
getAttributes()
getAttributes(
_attributes,_scene,_mesh):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:187
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
Inherited from
MaterialPluginBase.getAttributes
getClassName()
getClassName():
string
Defined in: apps/client/src/renderer/level-batches.ts:142
Gets the current class name useful for serialization or dynamic coding.
Returns
string
The class name.
Overrides
MaterialPluginBase.getClassName
getCustomCode()
getCustomCode(
shaderType):Record<string,string> |null
Defined in: apps/client/src/renderer/level-batches.ts:130
Returns a list of custom shader code fragments to customize the shader.
Parameters
shaderType
string
Returns
Record<string, string> | null
null if no code to be added, or a list of pointName => code. Note that pointName can also be a regular expression if it starts with a !. In that case, the string found by the regular expression (if any) will be replaced by the code provided.
Overrides
MaterialPluginBase.getCustomCode
getSamplers()
getSamplers(
_samplers):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:180
Gets the samplers used by the plugin.
Parameters
_samplers
string[]
list that the sampler names should be added to.
Returns
void
Inherited from
MaterialPluginBase.getSamplers
getUniformBuffersNames()
getUniformBuffersNames(
_ubos):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:192
Gets the uniform buffers names added by the plugin.
Parameters
_ubos
string[]
list that the ubo names should be added to.
Returns
void
Inherited from
MaterialPluginBase.getUniformBuffersNames
getUniforms()
getUniforms():
object
Defined in: apps/client/src/renderer/level-batches.ts:112
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)
Returns
object
the description of the uniforms
fragment
fragment:
string
ubo
ubo:
object[]
Overrides
MaterialPluginBase.getUniforms
hardBindForSubMesh()
hardBindForSubMesh(
_uniformBuffer,_scene,_engine,_subMesh):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:92
Binds 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
Inherited from
MaterialPluginBase.hardBindForSubMesh
hasRenderTargetTextures()
hasRenderTargetTextures():
boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:152
Gets a boolean indicating that current material needs to register RTT
Returns
boolean
true if this uses a render target otherwise false.
Inherited from
MaterialPluginBase.hasRenderTargetTextures
hasTexture()
hasTexture(
_texture):boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:147
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.
Inherited from
MaterialPluginBase.hasTexture
isCompatible()
isCompatible(
shaderLanguage):boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:52
Gets a boolean indicating that the plugin is compatible with a given shader language.
Parameters
shaderLanguage
ShaderLanguage
The shader language to use.
Returns
boolean
true if the plugin is compatible with the shader language
Inherited from
MaterialPluginBase.isCompatible
isReadyForSubMesh()
isReadyForSubMesh(
_defines,_scene,_engine,_subMesh):boolean
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:84
Specifies that the submesh is ready to be used.
Parameters
_defines
MaterialDefines
the list of "defines" to update.
_scene
Scene
defines the scene the material belongs to.
_engine
AbstractEngine
the engine this scene belongs to.
_subMesh
SubMesh
the submesh to check for readiness
Returns
boolean
- boolean indicating that the submesh is ready or not.
Inherited from
MaterialPluginBase.isReadyForSubMesh
parse()
parse(
source,scene,rootUrl):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:225
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
Inherited from
MaterialPluginBase.parse
prepareDefines()
prepareDefines(
defines):void
Defined in: apps/client/src/renderer/level-batches.ts:108
Sets the defines for the next rendering
Parameters
defines
MaterialDefines
Returns
void
Overrides
MaterialPluginBase.prepareDefines
prepareDefinesBeforeAttributes()
prepareDefinesBeforeAttributes(
_defines,_scene,_mesh):void
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:134
Sets 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
Inherited from
MaterialPluginBase.prepareDefinesBeforeAttributes
serialize()
serialize():
any
Defined in: node_modules/@babylonjs/core/Materials/materialPluginBase.pure.d.ts:218
Serializes this plugin configuration.
Returns
any
- An object with the serialized config.
Inherited from
MaterialPluginBase.serialize