@babylonjs/core 7.29.0 → 7.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Engines/WebGPU/webgpuCacheBindGroups.js +13 -2
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheSampler.js +2 -3
- package/Engines/WebGPU/webgpuCacheSampler.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +4 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +2 -1
- package/Engines/nullEngine.d.ts +1 -0
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +4 -0
- package/Engines/webgpuEngine.js +1 -3
- package/Engines/webgpuEngine.js.map +1 -1
- package/Materials/Background/backgroundMaterial.js +1 -11
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.d.ts +8 -0
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js +43 -34
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.d.ts +32 -0
- package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js +64 -0
- package/Materials/Node/Blocks/GaussianSplatting/gaussianBlock.js.map +1 -0
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.d.ts +48 -0
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js +102 -0
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.js.map +1 -0
- package/Materials/Node/Blocks/GaussianSplatting/index.d.ts +3 -0
- package/Materials/Node/Blocks/GaussianSplatting/index.js +4 -0
- package/Materials/Node/Blocks/GaussianSplatting/index.js.map +1 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.d.ts +40 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js +96 -0
- package/Materials/Node/Blocks/GaussianSplatting/splatReaderBlock.js.map +1 -0
- package/Materials/Node/Blocks/Input/inputBlock.js +6 -0
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/index.d.ts +1 -0
- package/Materials/Node/Blocks/index.js +1 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Node/Enums/nodeMaterialModes.d.ts +3 -1
- package/Materials/Node/Enums/nodeMaterialModes.js +2 -0
- package/Materials/Node/Enums/nodeMaterialModes.js.map +1 -1
- package/Materials/Node/index.d.ts +1 -0
- package/Materials/Node/index.js +1 -0
- package/Materials/Node/index.js.map +1 -1
- package/Materials/Node/nodeMaterialDefault.d.ts +6 -0
- package/Materials/Node/nodeMaterialDefault.js +53 -0
- package/Materials/Node/nodeMaterialDefault.js.map +1 -0
- package/Materials/PBR/pbrBaseMaterial.js +1 -11
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +12 -0
- package/Materials/Textures/rawTexture3D.js +18 -0
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/texture.js +7 -3
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/textureSampler.d.ts +1 -1
- package/Materials/Textures/textureSampler.js.map +1 -1
- package/Materials/effect.d.ts +11 -0
- package/Materials/effect.js +20 -0
- package/Materials/effect.js.map +1 -1
- package/Materials/material.d.ts +5 -1
- package/Materials/material.js +19 -1
- package/Materials/material.js.map +1 -1
- package/Materials/materialPluginBase.d.ts +46 -46
- package/Materials/materialPluginBase.js +46 -60
- package/Materials/materialPluginBase.js.map +1 -1
- package/Materials/materialPluginManager.js +2 -2
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/pushMaterial.d.ts +1 -1
- package/Materials/pushMaterial.js +2 -2
- package/Materials/pushMaterial.js.map +1 -1
- package/Materials/standardMaterial.js +1 -11
- package/Materials/standardMaterial.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +11 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +72 -37
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Set/aggregatorBlock.d.ts +76 -0
- package/Meshes/Node/Blocks/Set/aggregatorBlock.js +210 -0
- package/Meshes/Node/Blocks/Set/aggregatorBlock.js.map +1 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.d.ts +91 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js +194 -0
- package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -0
- package/Meshes/Node/Blocks/booleanGeometryBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/booleanGeometryBlock.js +16 -4
- package/Meshes/Node/Blocks/booleanGeometryBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +8 -0
- package/Meshes/Node/Blocks/geometryClampBlock.js +22 -6
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInputBlock.js +2 -0
- package/Meshes/Node/Blocks/geometryInputBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryInterceptorBlock.d.ts +5 -0
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js +5 -1
- package/Meshes/Node/Blocks/geometryInterceptorBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryTransformBlock.d.ts +6 -0
- package/Meshes/Node/Blocks/geometryTransformBlock.js +14 -2
- package/Meshes/Node/Blocks/geometryTransformBlock.js.map +1 -1
- package/Meshes/Node/Enums/nodeGeometryContextualSources.d.ts +5 -1
- package/Meshes/Node/Enums/nodeGeometryContextualSources.js +4 -0
- package/Meshes/Node/Enums/nodeGeometryContextualSources.js.map +1 -1
- package/Meshes/Node/index.d.ts +2 -0
- package/Meshes/Node/index.js +2 -0
- package/Meshes/Node/index.js.map +1 -1
- package/Meshes/Node/nodeGeometry.d.ts +1 -1
- package/Meshes/Node/nodeGeometry.js +14 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +4 -0
- package/Meshes/Node/nodeGeometryBlock.js +6 -0
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBuildState.js +12 -0
- package/Meshes/Node/nodeGeometryBuildState.js.map +1 -1
- package/Meshes/csg.d.ts +1 -0
- package/Meshes/csg.js +1 -0
- package/Meshes/csg.js.map +1 -1
- package/Meshes/csg2.d.ts +126 -0
- package/Meshes/csg2.js +350 -0
- package/Meshes/csg2.js.map +1 -0
- package/Meshes/index.d.ts +2 -0
- package/Meshes/index.js +2 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/lattice.d.ts +18 -1
- package/Meshes/lattice.js +34 -6
- package/Meshes/lattice.js.map +1 -1
- package/Meshes/lattice.material.d.ts +82 -0
- package/Meshes/lattice.material.js +259 -0
- package/Meshes/lattice.material.js.map +1 -0
- package/Meshes/mesh.js +3 -1
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +66 -1
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Misc/dumpTools.js +1 -0
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/screenshotTools.js +0 -3
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +2 -1
- package/Misc/tools.internals.d.ts +13 -0
- package/Misc/tools.internals.js +48 -0
- package/Misc/tools.internals.js.map +1 -0
- package/Misc/tools.js +13 -4
- package/Misc/tools.js.map +1 -1
- package/Morph/morphTarget.js +1 -0
- package/Morph/morphTarget.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplatting.d.ts +5 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js +33 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.d.ts +7 -0
- package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js +19 -0
- package/Shaders/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingUboDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +1 -2
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.d.ts +1 -2
- package/Shaders/gaussianSplatting.fragment.js +5 -10
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.d.ts +1 -0
- package/Shaders/gaussianSplatting.vertex.js +4 -21
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +1 -1
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +1 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/Sprites/spriteManager.d.ts +10 -1
- package/Sprites/spriteManager.js +3 -2
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spritePackedManager.d.ts +6 -1
- package/Sprites/spritePackedManager.js +6 -2
- package/Sprites/spritePackedManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +16 -3
- package/Sprites/spriteRenderer.js +5 -3
- package/Sprites/spriteRenderer.js.map +1 -1
- package/package.json +1 -1
|
@@ -70,44 +70,44 @@ export declare class MaterialPluginBase {
|
|
|
70
70
|
getClassName(): string;
|
|
71
71
|
/**
|
|
72
72
|
* Specifies that the submesh is ready to be used.
|
|
73
|
-
* @param
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
76
|
-
* @param
|
|
73
|
+
* @param _defines the list of "defines" to update.
|
|
74
|
+
* @param _scene defines the scene the material belongs to.
|
|
75
|
+
* @param _engine the engine this scene belongs to.
|
|
76
|
+
* @param _subMesh the submesh to check for readiness
|
|
77
77
|
* @returns - boolean indicating that the submesh is ready or not.
|
|
78
78
|
*/
|
|
79
|
-
isReadyForSubMesh(
|
|
79
|
+
isReadyForSubMesh(_defines: MaterialDefines, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): boolean;
|
|
80
80
|
/**
|
|
81
81
|
* Binds the material data (this function is called even if mustRebind() returns false)
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
82
|
+
* @param _uniformBuffer defines the Uniform buffer to fill in.
|
|
83
|
+
* @param _scene defines the scene the material belongs to.
|
|
84
|
+
* @param _engine defines the engine the material belongs to.
|
|
85
|
+
* @param _subMesh the submesh to bind data for
|
|
86
86
|
*/
|
|
87
|
-
hardBindForSubMesh(
|
|
87
|
+
hardBindForSubMesh(_uniformBuffer: UniformBuffer, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): void;
|
|
88
88
|
/**
|
|
89
89
|
* Binds the material data.
|
|
90
|
-
* @param
|
|
91
|
-
* @param
|
|
92
|
-
* @param
|
|
93
|
-
* @param
|
|
90
|
+
* @param _uniformBuffer defines the Uniform buffer to fill in.
|
|
91
|
+
* @param _scene defines the scene the material belongs to.
|
|
92
|
+
* @param _engine the engine this scene belongs to.
|
|
93
|
+
* @param _subMesh the submesh to bind data for
|
|
94
94
|
*/
|
|
95
|
-
bindForSubMesh(
|
|
95
|
+
bindForSubMesh(_uniformBuffer: UniformBuffer, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): void;
|
|
96
96
|
/**
|
|
97
97
|
* Disposes the resources of the material.
|
|
98
|
-
* @param
|
|
98
|
+
* @param _forceDisposeTextures - Forces the disposal of all textures.
|
|
99
99
|
*/
|
|
100
|
-
dispose(
|
|
100
|
+
dispose(_forceDisposeTextures?: boolean): void;
|
|
101
101
|
/**
|
|
102
102
|
* Returns a list of custom shader code fragments to customize the shader.
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
103
|
+
* @param _shaderType "vertex" or "fragment"
|
|
104
|
+
* @param _shaderLanguage The shader language to use.
|
|
105
105
|
* @returns null if no code to be added, or a list of pointName =\> code.
|
|
106
106
|
* Note that `pointName` can also be a regular expression if it starts with a `!`.
|
|
107
107
|
* In that case, the string found by the regular expression (if any) will be
|
|
108
108
|
* replaced by the code provided.
|
|
109
109
|
*/
|
|
110
|
-
getCustomCode(
|
|
110
|
+
getCustomCode(_shaderType: string, _shaderLanguage?: ShaderLanguage): Nullable<{
|
|
111
111
|
[pointName: string]: string;
|
|
112
112
|
}>;
|
|
113
113
|
/**
|
|
@@ -122,24 +122,24 @@ export declare class MaterialPluginBase {
|
|
|
122
122
|
}): void;
|
|
123
123
|
/**
|
|
124
124
|
* Sets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.
|
|
125
|
-
* @param
|
|
126
|
-
* @param
|
|
127
|
-
* @param
|
|
125
|
+
* @param _defines the list of "defines" to update.
|
|
126
|
+
* @param _scene defines the scene to the material belongs to.
|
|
127
|
+
* @param _mesh the mesh being rendered
|
|
128
128
|
*/
|
|
129
|
-
prepareDefinesBeforeAttributes(
|
|
129
|
+
prepareDefinesBeforeAttributes(_defines: MaterialDefines, _scene: Scene, _mesh: AbstractMesh): void;
|
|
130
130
|
/**
|
|
131
131
|
* Sets the defines for the next rendering
|
|
132
|
-
* @param
|
|
133
|
-
* @param
|
|
134
|
-
* @param
|
|
132
|
+
* @param _defines the list of "defines" to update.
|
|
133
|
+
* @param _scene defines the scene to the material belongs to.
|
|
134
|
+
* @param _mesh the mesh being rendered
|
|
135
135
|
*/
|
|
136
|
-
prepareDefines(
|
|
136
|
+
prepareDefines(_defines: MaterialDefines, _scene: Scene, _mesh: AbstractMesh): void;
|
|
137
137
|
/**
|
|
138
138
|
* Checks to see if a texture is used in the material.
|
|
139
|
-
* @param
|
|
139
|
+
* @param _texture - Base texture to use.
|
|
140
140
|
* @returns - Boolean specifying if a texture is used in the material.
|
|
141
141
|
*/
|
|
142
|
-
hasTexture(
|
|
142
|
+
hasTexture(_texture: BaseTexture): boolean;
|
|
143
143
|
/**
|
|
144
144
|
* Gets a boolean indicating that current material needs to register RTT
|
|
145
145
|
* @returns true if this uses a render target otherwise false.
|
|
@@ -147,19 +147,19 @@ export declare class MaterialPluginBase {
|
|
|
147
147
|
hasRenderTargetTextures(): boolean;
|
|
148
148
|
/**
|
|
149
149
|
* Fills the list of render target textures.
|
|
150
|
-
* @param
|
|
150
|
+
* @param _renderTargets the list of render targets to update
|
|
151
151
|
*/
|
|
152
|
-
fillRenderTargetTextures(
|
|
152
|
+
fillRenderTargetTextures(_renderTargets: SmartArray<RenderTargetTexture>): void;
|
|
153
153
|
/**
|
|
154
154
|
* Returns an array of the actively used textures.
|
|
155
|
-
* @param
|
|
155
|
+
* @param _activeTextures Array of BaseTextures
|
|
156
156
|
*/
|
|
157
|
-
getActiveTextures(
|
|
157
|
+
getActiveTextures(_activeTextures: BaseTexture[]): void;
|
|
158
158
|
/**
|
|
159
159
|
* Returns the animatable textures.
|
|
160
|
-
* @param
|
|
160
|
+
* @param _animatables Array of animatable textures.
|
|
161
161
|
*/
|
|
162
|
-
getAnimatables(
|
|
162
|
+
getAnimatables(_animatables: IAnimatable[]): void;
|
|
163
163
|
/**
|
|
164
164
|
* Add fallbacks to the effect fallbacks list.
|
|
165
165
|
* @param defines defines the Base texture to use.
|
|
@@ -170,27 +170,27 @@ export declare class MaterialPluginBase {
|
|
|
170
170
|
addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number;
|
|
171
171
|
/**
|
|
172
172
|
* Gets the samplers used by the plugin.
|
|
173
|
-
* @param
|
|
173
|
+
* @param _samplers list that the sampler names should be added to.
|
|
174
174
|
*/
|
|
175
|
-
getSamplers(
|
|
175
|
+
getSamplers(_samplers: string[]): void;
|
|
176
176
|
/**
|
|
177
177
|
* Gets the attributes used by the plugin.
|
|
178
|
-
* @param
|
|
179
|
-
* @param
|
|
180
|
-
* @param
|
|
178
|
+
* @param _attributes list that the attribute names should be added to.
|
|
179
|
+
* @param _scene the scene that the material belongs to.
|
|
180
|
+
* @param _mesh the mesh being rendered.
|
|
181
181
|
*/
|
|
182
|
-
getAttributes(
|
|
182
|
+
getAttributes(_attributes: string[], _scene: Scene, _mesh: AbstractMesh): void;
|
|
183
183
|
/**
|
|
184
184
|
* Gets the uniform buffers names added by the plugin.
|
|
185
|
-
* @param
|
|
185
|
+
* @param _ubos list that the ubo names should be added to.
|
|
186
186
|
*/
|
|
187
|
-
getUniformBuffersNames(
|
|
187
|
+
getUniformBuffersNames(_ubos: string[]): void;
|
|
188
188
|
/**
|
|
189
189
|
* 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)
|
|
190
|
-
* @param
|
|
190
|
+
* @param _shaderLanguage The shader language to use.
|
|
191
191
|
* @returns the description of the uniforms
|
|
192
192
|
*/
|
|
193
|
-
getUniforms(
|
|
193
|
+
getUniforms(_shaderLanguage?: ShaderLanguage): {
|
|
194
194
|
ubo?: Array<{
|
|
195
195
|
name: string;
|
|
196
196
|
size?: number;
|
|
@@ -79,51 +79,46 @@ export class MaterialPluginBase {
|
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
81
|
* Specifies that the submesh is ready to be used.
|
|
82
|
-
* @param
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @param
|
|
82
|
+
* @param _defines the list of "defines" to update.
|
|
83
|
+
* @param _scene defines the scene the material belongs to.
|
|
84
|
+
* @param _engine the engine this scene belongs to.
|
|
85
|
+
* @param _subMesh the submesh to check for readiness
|
|
86
86
|
* @returns - boolean indicating that the submesh is ready or not.
|
|
87
87
|
*/
|
|
88
|
-
|
|
89
|
-
isReadyForSubMesh(defines, scene, engine, subMesh) {
|
|
88
|
+
isReadyForSubMesh(_defines, _scene, _engine, _subMesh) {
|
|
90
89
|
return true;
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
93
92
|
* Binds the material data (this function is called even if mustRebind() returns false)
|
|
94
|
-
* @param
|
|
95
|
-
* @param
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
93
|
+
* @param _uniformBuffer defines the Uniform buffer to fill in.
|
|
94
|
+
* @param _scene defines the scene the material belongs to.
|
|
95
|
+
* @param _engine defines the engine the material belongs to.
|
|
96
|
+
* @param _subMesh the submesh to bind data for
|
|
98
97
|
*/
|
|
99
|
-
|
|
100
|
-
hardBindForSubMesh(uniformBuffer, scene, engine, subMesh) { }
|
|
98
|
+
hardBindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) { }
|
|
101
99
|
/**
|
|
102
100
|
* Binds the material data.
|
|
103
|
-
* @param
|
|
104
|
-
* @param
|
|
105
|
-
* @param
|
|
106
|
-
* @param
|
|
101
|
+
* @param _uniformBuffer defines the Uniform buffer to fill in.
|
|
102
|
+
* @param _scene defines the scene the material belongs to.
|
|
103
|
+
* @param _engine the engine this scene belongs to.
|
|
104
|
+
* @param _subMesh the submesh to bind data for
|
|
107
105
|
*/
|
|
108
|
-
|
|
109
|
-
bindForSubMesh(uniformBuffer, scene, engine, subMesh) { }
|
|
106
|
+
bindForSubMesh(_uniformBuffer, _scene, _engine, _subMesh) { }
|
|
110
107
|
/**
|
|
111
108
|
* Disposes the resources of the material.
|
|
112
|
-
* @param
|
|
109
|
+
* @param _forceDisposeTextures - Forces the disposal of all textures.
|
|
113
110
|
*/
|
|
114
|
-
|
|
115
|
-
dispose(forceDisposeTextures) { }
|
|
111
|
+
dispose(_forceDisposeTextures) { }
|
|
116
112
|
/**
|
|
117
113
|
* Returns a list of custom shader code fragments to customize the shader.
|
|
118
|
-
* @param
|
|
119
|
-
* @param
|
|
114
|
+
* @param _shaderType "vertex" or "fragment"
|
|
115
|
+
* @param _shaderLanguage The shader language to use.
|
|
120
116
|
* @returns null if no code to be added, or a list of pointName =\> code.
|
|
121
117
|
* Note that `pointName` can also be a regular expression if it starts with a `!`.
|
|
122
118
|
* In that case, the string found by the regular expression (if any) will be
|
|
123
119
|
* replaced by the code provided.
|
|
124
120
|
*/
|
|
125
|
-
|
|
126
|
-
getCustomCode(shaderType, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
|
|
121
|
+
getCustomCode(_shaderType, _shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
|
|
127
122
|
return null;
|
|
128
123
|
}
|
|
129
124
|
/**
|
|
@@ -147,27 +142,24 @@ export class MaterialPluginBase {
|
|
|
147
142
|
}
|
|
148
143
|
/**
|
|
149
144
|
* Sets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.
|
|
150
|
-
* @param
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
145
|
+
* @param _defines the list of "defines" to update.
|
|
146
|
+
* @param _scene defines the scene to the material belongs to.
|
|
147
|
+
* @param _mesh the mesh being rendered
|
|
153
148
|
*/
|
|
154
|
-
|
|
155
|
-
prepareDefinesBeforeAttributes(defines, scene, mesh) { }
|
|
149
|
+
prepareDefinesBeforeAttributes(_defines, _scene, _mesh) { }
|
|
156
150
|
/**
|
|
157
151
|
* Sets the defines for the next rendering
|
|
158
|
-
* @param
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
152
|
+
* @param _defines the list of "defines" to update.
|
|
153
|
+
* @param _scene defines the scene to the material belongs to.
|
|
154
|
+
* @param _mesh the mesh being rendered
|
|
161
155
|
*/
|
|
162
|
-
|
|
163
|
-
prepareDefines(defines, scene, mesh) { }
|
|
156
|
+
prepareDefines(_defines, _scene, _mesh) { }
|
|
164
157
|
/**
|
|
165
158
|
* Checks to see if a texture is used in the material.
|
|
166
|
-
* @param
|
|
159
|
+
* @param _texture - Base texture to use.
|
|
167
160
|
* @returns - Boolean specifying if a texture is used in the material.
|
|
168
161
|
*/
|
|
169
|
-
|
|
170
|
-
hasTexture(texture) {
|
|
162
|
+
hasTexture(_texture) {
|
|
171
163
|
return false;
|
|
172
164
|
}
|
|
173
165
|
/**
|
|
@@ -179,22 +171,19 @@ export class MaterialPluginBase {
|
|
|
179
171
|
}
|
|
180
172
|
/**
|
|
181
173
|
* Fills the list of render target textures.
|
|
182
|
-
* @param
|
|
174
|
+
* @param _renderTargets the list of render targets to update
|
|
183
175
|
*/
|
|
184
|
-
|
|
185
|
-
fillRenderTargetTextures(renderTargets) { }
|
|
176
|
+
fillRenderTargetTextures(_renderTargets) { }
|
|
186
177
|
/**
|
|
187
178
|
* Returns an array of the actively used textures.
|
|
188
|
-
* @param
|
|
179
|
+
* @param _activeTextures Array of BaseTextures
|
|
189
180
|
*/
|
|
190
|
-
|
|
191
|
-
getActiveTextures(activeTextures) { }
|
|
181
|
+
getActiveTextures(_activeTextures) { }
|
|
192
182
|
/**
|
|
193
183
|
* Returns the animatable textures.
|
|
194
|
-
* @param
|
|
184
|
+
* @param _animatables Array of animatable textures.
|
|
195
185
|
*/
|
|
196
|
-
|
|
197
|
-
getAnimatables(animatables) { }
|
|
186
|
+
getAnimatables(_animatables) { }
|
|
198
187
|
/**
|
|
199
188
|
* Add fallbacks to the effect fallbacks list.
|
|
200
189
|
* @param defines defines the Base texture to use.
|
|
@@ -207,30 +196,27 @@ export class MaterialPluginBase {
|
|
|
207
196
|
}
|
|
208
197
|
/**
|
|
209
198
|
* Gets the samplers used by the plugin.
|
|
210
|
-
* @param
|
|
199
|
+
* @param _samplers list that the sampler names should be added to.
|
|
211
200
|
*/
|
|
212
|
-
|
|
213
|
-
getSamplers(samplers) { }
|
|
201
|
+
getSamplers(_samplers) { }
|
|
214
202
|
/**
|
|
215
203
|
* Gets the attributes used by the plugin.
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
* @param
|
|
204
|
+
* @param _attributes list that the attribute names should be added to.
|
|
205
|
+
* @param _scene the scene that the material belongs to.
|
|
206
|
+
* @param _mesh the mesh being rendered.
|
|
219
207
|
*/
|
|
220
|
-
|
|
221
|
-
getAttributes(attributes, scene, mesh) { }
|
|
208
|
+
getAttributes(_attributes, _scene, _mesh) { }
|
|
222
209
|
/**
|
|
223
210
|
* Gets the uniform buffers names added by the plugin.
|
|
224
|
-
* @param
|
|
211
|
+
* @param _ubos list that the ubo names should be added to.
|
|
225
212
|
*/
|
|
226
|
-
|
|
227
|
-
getUniformBuffersNames(ubos) { }
|
|
213
|
+
getUniformBuffersNames(_ubos) { }
|
|
228
214
|
/**
|
|
229
215
|
* 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)
|
|
230
|
-
* @param
|
|
216
|
+
* @param _shaderLanguage The shader language to use.
|
|
231
217
|
* @returns the description of the uniforms
|
|
232
218
|
*/
|
|
233
|
-
getUniforms(
|
|
219
|
+
getUniforms(_shaderLanguage = 0 /* ShaderLanguage.GLSL */) {
|
|
234
220
|
return {};
|
|
235
221
|
}
|
|
236
222
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialPluginBase.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/materialPluginBase.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAajD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IA6B3B;;;;OAIG;IACI,YAAY,CAAC,cAA8B;QAC9C,QAAQ,cAAc,EAAE;YACpB;gBACI,OAAO,IAAI,CAAC;YAChB;gBACI,OAAO,KAAK,CAAC;SACpB;IACL,CAAC;IAES,OAAO,CAAC,MAAe;QAC7B,IAAI,MAAM,EAAE;YACR,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;SAC7C;IACL,CAAC;I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C;CACJ;AA1SU;IADN,SAAS,EAAE;gDACQ;AAMb;IADN,SAAS,EAAE;oDACkB;AAMvB;IADN,SAAS,EAAE;2DAC4B;AAMjC;IADN,SAAS,EAAE;kEACmC;AA0RnD,sBAAsB;AACtB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { MaterialPluginManager } from \"./materialPluginManager\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { IAnimatable } from \"../Animations/animatable.interface\";\r\nimport type { UniformBuffer } from \"./uniformBuffer\";\r\nimport type { EffectFallbacks } from \"./effectFallbacks\";\r\nimport type { MaterialDefines } from \"./materialDefines\";\r\nimport type { Material } from \"./material\";\r\nimport type { BaseTexture } from \"./Textures/baseTexture\";\r\nimport type { RenderTargetTexture } from \"./Textures/renderTargetTexture\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { ShaderLanguage } from \"./shaderLanguage\";\r\n\r\n/**\r\n * Base class for material plugins.\r\n * @since 5.0\r\n */\r\nexport class MaterialPluginBase {\r\n /**\r\n * Defines the name of the plugin\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Defines the priority of the plugin. Lower numbers run first.\r\n */\r\n @serialize()\r\n public priority: number = 500;\r\n\r\n /**\r\n * Indicates that any #include directive in the plugin code must be replaced by the corresponding code.\r\n */\r\n @serialize()\r\n public resolveIncludes: boolean = false;\r\n\r\n /**\r\n * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)\r\n */\r\n @serialize()\r\n public registerForExtraEvents: boolean = false;\r\n\r\n protected _material: Material;\r\n protected _pluginManager: MaterialPluginManager;\r\n protected _pluginDefineNames?: { [name: string]: any };\r\n\r\n /**\r\n * Gets a boolean indicating that the plugin is compatible with a given shader language.\r\n * @param shaderLanguage The shader language to use.\r\n * @returns true if the plugin is compatible with the shader language\r\n */\r\n public isCompatible(shaderLanguage: ShaderLanguage): boolean {\r\n switch (shaderLanguage) {\r\n case ShaderLanguage.GLSL:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n protected _enable(enable: boolean) {\r\n if (enable) {\r\n this._pluginManager._activatePlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to mark defines as being dirty.\r\n */\r\n public readonly markAllDefinesAsDirty: () => void;\r\n\r\n /**\r\n * Creates a new material plugin\r\n * @param material parent material of the plugin\r\n * @param name name of the plugin\r\n * @param priority priority of the plugin\r\n * @param defines list of defines used by the plugin. The value of the property is the default value for this property\r\n * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)\r\n * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)\r\n * @param resolveIncludes Indicates that any #include directive in the plugin code must be replaced by the corresponding code (default: false)\r\n */\r\n constructor(material: Material, name: string, priority: number, defines?: { [key: string]: any }, addToPluginList = true, enable = false, resolveIncludes = false) {\r\n this._material = material;\r\n this.name = name;\r\n this.priority = priority;\r\n this.resolveIncludes = resolveIncludes;\r\n\r\n if (!material.pluginManager) {\r\n material.pluginManager = new MaterialPluginManager(material);\r\n material.onDisposeObservable.add(() => {\r\n material.pluginManager = undefined;\r\n });\r\n }\r\n\r\n this._pluginDefineNames = defines;\r\n this._pluginManager = material.pluginManager;\r\n\r\n if (addToPluginList) {\r\n this._pluginManager._addPlugin(this);\r\n }\r\n\r\n if (enable) {\r\n this._enable(true);\r\n }\r\n\r\n this.markAllDefinesAsDirty = material._dirtyCallbacks[Constants.MATERIAL_AllDirtyFlag];\r\n }\r\n\r\n /**\r\n * Gets the current class name useful for serialization or dynamic coding.\r\n * @returns The class name.\r\n */\r\n public getClassName(): string {\r\n return \"MaterialPluginBase\";\r\n }\r\n\r\n /**\r\n * Specifies that the submesh is ready to be used.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to check for readiness\r\n * @returns - boolean indicating that the submesh is ready or not.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public isReadyForSubMesh(defines: MaterialDefines, scene: Scene, engine: AbstractEngine, subMesh: SubMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Binds the material data (this function is called even if mustRebind() returns false)\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine defines the engine the material belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hardBindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: AbstractEngine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Binds the material data.\r\n * @param uniformBuffer defines the Uniform buffer to fill in.\r\n * @param scene defines the scene the material belongs to.\r\n * @param engine the engine this scene belongs to.\r\n * @param subMesh the submesh to bind data for\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public bindForSubMesh(uniformBuffer: UniformBuffer, scene: Scene, engine: AbstractEngine, subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Disposes the resources of the material.\r\n * @param forceDisposeTextures - Forces the disposal of all textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public dispose(forceDisposeTextures?: boolean): void {}\r\n\r\n /**\r\n * Returns a list of custom shader code fragments to customize the shader.\r\n * @param shaderType \"vertex\" or \"fragment\"\r\n * @param shaderLanguage The shader language to use.\r\n * @returns null if no code to be added, or a list of pointName =\\> code.\r\n * Note that `pointName` can also be a regular expression if it starts with a `!`.\r\n * In that case, the string found by the regular expression (if any) will be\r\n * replaced by the code provided.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getCustomCode(shaderType: string, shaderLanguage = ShaderLanguage.GLSL): Nullable<{ [pointName: string]: string }> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Collects all defines.\r\n * @param defines The object to append to.\r\n */\r\n public collectDefines(defines: { [name: string]: { type: string; default: any } }): void {\r\n if (!this._pluginDefineNames) {\r\n return;\r\n }\r\n for (const key of Object.keys(this._pluginDefineNames)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n const type = typeof this._pluginDefineNames[key];\r\n defines[key] = {\r\n type: type === \"number\" ? \"number\" : type === \"string\" ? \"string\" : type === \"boolean\" ? \"boolean\" : \"object\",\r\n default: this._pluginDefineNames[key],\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Sets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefinesBeforeAttributes(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Sets the defines for the next rendering\r\n * @param defines the list of \"defines\" to update.\r\n * @param scene defines the scene to the material belongs to.\r\n * @param mesh the mesh being rendered\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public prepareDefines(defines: MaterialDefines, scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Checks to see if a texture is used in the material.\r\n * @param texture - Base texture to use.\r\n * @returns - Boolean specifying if a texture is used in the material.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public hasTexture(texture: BaseTexture): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n * @returns true if this uses a render target otherwise false.\r\n */\r\n public hasRenderTargetTextures(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Fills the list of render target textures.\r\n * @param renderTargets the list of render targets to update\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public fillRenderTargetTextures(renderTargets: SmartArray<RenderTargetTexture>): void {}\r\n\r\n /**\r\n * Returns an array of the actively used textures.\r\n * @param activeTextures Array of BaseTextures\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getActiveTextures(activeTextures: BaseTexture[]): void {}\r\n\r\n /**\r\n * Returns the animatable textures.\r\n * @param animatables Array of animatable textures.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAnimatables(animatables: IAnimatable[]): void {}\r\n\r\n /**\r\n * Add fallbacks to the effect fallbacks list.\r\n * @param defines defines the Base texture to use.\r\n * @param fallbacks defines the current fallback list.\r\n * @param currentRank defines the current fallback rank.\r\n * @returns the new fallback rank.\r\n */\r\n public addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n return currentRank;\r\n }\r\n\r\n /**\r\n * Gets the samplers used by the plugin.\r\n * @param samplers list that the sampler names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getSamplers(samplers: string[]): void {}\r\n\r\n /**\r\n * Gets the attributes used by the plugin.\r\n * @param attributes list that the attribute names should be added to.\r\n * @param scene the scene that the material belongs to.\r\n * @param mesh the mesh being rendered.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getAttributes(attributes: string[], scene: Scene, mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Gets the uniform buffers names added by the plugin.\r\n * @param ubos list that the ubo names should be added to.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public getUniformBuffersNames(ubos: string[]): void {}\r\n\r\n /**\r\n * 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)\r\n * @param shaderLanguage The shader language to use.\r\n * @returns the description of the uniforms\r\n */\r\n public getUniforms(shaderLanguage = ShaderLanguage.GLSL): {\r\n ubo?: Array<{ name: string; size?: number; type?: string; arraySize?: number }>;\r\n vertex?: string;\r\n fragment?: string;\r\n } {\r\n return {};\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public copyTo(plugin: MaterialPluginBase): void {\r\n SerializationHelper.Clone(() => plugin, this);\r\n }\r\n\r\n /**\r\n * Serializes this plugin configuration.\r\n * @returns - An object with the serialized config.\r\n */\r\n public serialize(): any {\r\n return SerializationHelper.Serialize(this);\r\n }\r\n\r\n /**\r\n * Parses a plugin configuration from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene Defines the scene we are parsing for\r\n * @param rootUrl Defines the rootUrl to load from\r\n */\r\n public parse(source: any, scene: Scene, rootUrl: string): void {\r\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\r\n }\r\n}\r\n\r\n// Register Class Name\r\nRegisterClass(\"BABYLON.MaterialPluginBase\", MaterialPluginBase);\r\n"]}
|
|
1
|
+
{"version":3,"file":"materialPluginBase.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/materialPluginBase.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAajD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,kBAAkB;IA6B3B;;;;OAIG;IACI,YAAY,CAAC,cAA8B;QAC9C,QAAQ,cAAc,EAAE;YACpB;gBACI,OAAO,IAAI,CAAC;YAChB;gBACI,OAAO,KAAK,CAA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,EAAE;oDACkB;AAMvB;IADN,SAAS,EAAE;2DAC4B;AAMjC;IADN,SAAS,EAAE;kEACmC;AA4QnD,sBAAsB;AACtB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { serialize } from \"../Misc/decorators\";\r\nimport type { Nullable } from \"../types\";\r\nimport { MaterialPluginManager } from \"./materialPluginManager\";\r\nimport type { SmartArray } from \"../Misc/smartArray\";\r\nimport { Constants } from \"../Engines/constants\";\r\n\r\nimport type { AbstractEngine } from \"../Engines/abstractEngine\";\r\nimport type { Scene } from \"../scene\";\r\nimport type { AbstractMesh } from \"../Meshes/abstractMesh\";\r\nimport type { SubMesh } from \"../Meshes/subMesh\";\r\nimport type { IAnimatable } from \"../Animations/animatable.interface\";\r\nimport type { UniformBuffer } from \"./uniformBuffer\";\r\nimport type { EffectFallbacks } from \"./effectFallbacks\";\r\nimport type { MaterialDefines } from \"./materialDefines\";\r\nimport type { Material } from \"./material\";\r\nimport type { BaseTexture } from \"./Textures/baseTexture\";\r\nimport type { RenderTargetTexture } from \"./Textures/renderTargetTexture\";\r\nimport { SerializationHelper } from \"../Misc/decorators.serialization\";\r\nimport { RegisterClass } from \"../Misc/typeStore\";\r\nimport { ShaderLanguage } from \"./shaderLanguage\";\r\n\r\n/**\r\n * Base class for material plugins.\r\n * @since 5.0\r\n */\r\nexport class MaterialPluginBase {\r\n /**\r\n * Defines the name of the plugin\r\n */\r\n @serialize()\r\n public name: string;\r\n\r\n /**\r\n * Defines the priority of the plugin. Lower numbers run first.\r\n */\r\n @serialize()\r\n public priority: number = 500;\r\n\r\n /**\r\n * Indicates that any #include directive in the plugin code must be replaced by the corresponding code.\r\n */\r\n @serialize()\r\n public resolveIncludes: boolean = false;\r\n\r\n /**\r\n * Indicates that this plugin should be notified for the extra events (HasRenderTargetTextures / FillRenderTargetTextures / HardBindForSubMesh)\r\n */\r\n @serialize()\r\n public registerForExtraEvents: boolean = false;\r\n\r\n protected _material: Material;\r\n protected _pluginManager: MaterialPluginManager;\r\n protected _pluginDefineNames?: { [name: string]: any };\r\n\r\n /**\r\n * Gets a boolean indicating that the plugin is compatible with a given shader language.\r\n * @param shaderLanguage The shader language to use.\r\n * @returns true if the plugin is compatible with the shader language\r\n */\r\n public isCompatible(shaderLanguage: ShaderLanguage): boolean {\r\n switch (shaderLanguage) {\r\n case ShaderLanguage.GLSL:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n protected _enable(enable: boolean) {\r\n if (enable) {\r\n this._pluginManager._activatePlugin(this);\r\n }\r\n }\r\n\r\n /**\r\n * Helper function to mark defines as being dirty.\r\n */\r\n public readonly markAllDefinesAsDirty: () => void;\r\n\r\n /**\r\n * Creates a new material plugin\r\n * @param material parent material of the plugin\r\n * @param name name of the plugin\r\n * @param priority priority of the plugin\r\n * @param defines list of defines used by the plugin. The value of the property is the default value for this property\r\n * @param addToPluginList true to add the plugin to the list of plugins managed by the material plugin manager of the material (default: true)\r\n * @param enable true to enable the plugin (it is handy if the plugin does not handle properties to switch its current activation)\r\n * @param resolveIncludes Indicates that any #include directive in the plugin code must be replaced by the corresponding code (default: false)\r\n */\r\n constructor(material: Material, name: string, priority: number, defines?: { [key: string]: any }, addToPluginList = true, enable = false, resolveIncludes = false) {\r\n this._material = material;\r\n this.name = name;\r\n this.priority = priority;\r\n this.resolveIncludes = resolveIncludes;\r\n\r\n if (!material.pluginManager) {\r\n material.pluginManager = new MaterialPluginManager(material);\r\n material.onDisposeObservable.add(() => {\r\n material.pluginManager = undefined;\r\n });\r\n }\r\n\r\n this._pluginDefineNames = defines;\r\n this._pluginManager = material.pluginManager;\r\n\r\n if (addToPluginList) {\r\n this._pluginManager._addPlugin(this);\r\n }\r\n\r\n if (enable) {\r\n this._enable(true);\r\n }\r\n\r\n this.markAllDefinesAsDirty = material._dirtyCallbacks[Constants.MATERIAL_AllDirtyFlag];\r\n }\r\n\r\n /**\r\n * Gets the current class name useful for serialization or dynamic coding.\r\n * @returns The class name.\r\n */\r\n public getClassName(): string {\r\n return \"MaterialPluginBase\";\r\n }\r\n\r\n /**\r\n * Specifies that the submesh is ready to be used.\r\n * @param _defines the list of \"defines\" to update.\r\n * @param _scene defines the scene the material belongs to.\r\n * @param _engine the engine this scene belongs to.\r\n * @param _subMesh the submesh to check for readiness\r\n * @returns - boolean indicating that the submesh is ready or not.\r\n */\r\n public isReadyForSubMesh(_defines: MaterialDefines, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): boolean {\r\n return true;\r\n }\r\n\r\n /**\r\n * Binds the material data (this function is called even if mustRebind() returns false)\r\n * @param _uniformBuffer defines the Uniform buffer to fill in.\r\n * @param _scene defines the scene the material belongs to.\r\n * @param _engine defines the engine the material belongs to.\r\n * @param _subMesh the submesh to bind data for\r\n */\r\n public hardBindForSubMesh(_uniformBuffer: UniformBuffer, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Binds the material data.\r\n * @param _uniformBuffer defines the Uniform buffer to fill in.\r\n * @param _scene defines the scene the material belongs to.\r\n * @param _engine the engine this scene belongs to.\r\n * @param _subMesh the submesh to bind data for\r\n */\r\n public bindForSubMesh(_uniformBuffer: UniformBuffer, _scene: Scene, _engine: AbstractEngine, _subMesh: SubMesh): void {}\r\n\r\n /**\r\n * Disposes the resources of the material.\r\n * @param _forceDisposeTextures - Forces the disposal of all textures.\r\n */\r\n public dispose(_forceDisposeTextures?: boolean): void {}\r\n\r\n /**\r\n * Returns a list of custom shader code fragments to customize the shader.\r\n * @param _shaderType \"vertex\" or \"fragment\"\r\n * @param _shaderLanguage The shader language to use.\r\n * @returns null if no code to be added, or a list of pointName =\\> code.\r\n * Note that `pointName` can also be a regular expression if it starts with a `!`.\r\n * In that case, the string found by the regular expression (if any) will be\r\n * replaced by the code provided.\r\n */\r\n public getCustomCode(_shaderType: string, _shaderLanguage = ShaderLanguage.GLSL): Nullable<{ [pointName: string]: string }> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Collects all defines.\r\n * @param defines The object to append to.\r\n */\r\n public collectDefines(defines: { [name: string]: { type: string; default: any } }): void {\r\n if (!this._pluginDefineNames) {\r\n return;\r\n }\r\n for (const key of Object.keys(this._pluginDefineNames)) {\r\n if (key[0] === \"_\") {\r\n continue;\r\n }\r\n\r\n const type = typeof this._pluginDefineNames[key];\r\n defines[key] = {\r\n type: type === \"number\" ? \"number\" : type === \"string\" ? \"string\" : type === \"boolean\" ? \"boolean\" : \"object\",\r\n default: this._pluginDefineNames[key],\r\n };\r\n }\r\n }\r\n\r\n /**\r\n * Sets the defines for the next rendering. Called before PrepareDefinesForAttributes is called.\r\n * @param _defines the list of \"defines\" to update.\r\n * @param _scene defines the scene to the material belongs to.\r\n * @param _mesh the mesh being rendered\r\n */\r\n public prepareDefinesBeforeAttributes(_defines: MaterialDefines, _scene: Scene, _mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Sets the defines for the next rendering\r\n * @param _defines the list of \"defines\" to update.\r\n * @param _scene defines the scene to the material belongs to.\r\n * @param _mesh the mesh being rendered\r\n */\r\n public prepareDefines(_defines: MaterialDefines, _scene: Scene, _mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Checks to see if a texture is used in the material.\r\n * @param _texture - Base texture to use.\r\n * @returns - Boolean specifying if a texture is used in the material.\r\n */\r\n public hasTexture(_texture: BaseTexture): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Gets a boolean indicating that current material needs to register RTT\r\n * @returns true if this uses a render target otherwise false.\r\n */\r\n public hasRenderTargetTextures(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Fills the list of render target textures.\r\n * @param _renderTargets the list of render targets to update\r\n */\r\n public fillRenderTargetTextures(_renderTargets: SmartArray<RenderTargetTexture>): void {}\r\n\r\n /**\r\n * Returns an array of the actively used textures.\r\n * @param _activeTextures Array of BaseTextures\r\n */\r\n public getActiveTextures(_activeTextures: BaseTexture[]): void {}\r\n\r\n /**\r\n * Returns the animatable textures.\r\n * @param _animatables Array of animatable textures.\r\n */\r\n public getAnimatables(_animatables: IAnimatable[]): void {}\r\n\r\n /**\r\n * Add fallbacks to the effect fallbacks list.\r\n * @param defines defines the Base texture to use.\r\n * @param fallbacks defines the current fallback list.\r\n * @param currentRank defines the current fallback rank.\r\n * @returns the new fallback rank.\r\n */\r\n public addFallbacks(defines: MaterialDefines, fallbacks: EffectFallbacks, currentRank: number): number {\r\n return currentRank;\r\n }\r\n\r\n /**\r\n * Gets the samplers used by the plugin.\r\n * @param _samplers list that the sampler names should be added to.\r\n */\r\n public getSamplers(_samplers: string[]): void {}\r\n\r\n /**\r\n * Gets the attributes used by the plugin.\r\n * @param _attributes list that the attribute names should be added to.\r\n * @param _scene the scene that the material belongs to.\r\n * @param _mesh the mesh being rendered.\r\n */\r\n public getAttributes(_attributes: string[], _scene: Scene, _mesh: AbstractMesh): void {}\r\n\r\n /**\r\n * Gets the uniform buffers names added by the plugin.\r\n * @param _ubos list that the ubo names should be added to.\r\n */\r\n public getUniformBuffersNames(_ubos: string[]): void {}\r\n\r\n /**\r\n * 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)\r\n * @param _shaderLanguage The shader language to use.\r\n * @returns the description of the uniforms\r\n */\r\n public getUniforms(_shaderLanguage = ShaderLanguage.GLSL): {\r\n ubo?: Array<{ name: string; size?: number; type?: string; arraySize?: number }>;\r\n vertex?: string;\r\n fragment?: string;\r\n } {\r\n return {};\r\n }\r\n\r\n /**\r\n * Makes a duplicate of the current configuration into another one.\r\n * @param plugin define the config where to copy the info\r\n */\r\n public copyTo(plugin: MaterialPluginBase): void {\r\n SerializationHelper.Clone(() => plugin, this);\r\n }\r\n\r\n /**\r\n * Serializes this plugin configuration.\r\n * @returns - An object with the serialized config.\r\n */\r\n public serialize(): any {\r\n return SerializationHelper.Serialize(this);\r\n }\r\n\r\n /**\r\n * Parses a plugin configuration from a serialized object.\r\n * @param source - Serialized object.\r\n * @param scene Defines the scene we are parsing for\r\n * @param rootUrl Defines the rootUrl to load from\r\n */\r\n public parse(source: any, scene: Scene, rootUrl: string): void {\r\n SerializationHelper.Parse(() => this, source, scene, rootUrl);\r\n }\r\n}\r\n\r\n// Register Class Name\r\nRegisterClass(\"BABYLON.MaterialPluginBase\", MaterialPluginBase);\r\n"]}
|
|
@@ -31,8 +31,8 @@ export class MaterialPluginManager {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
if (this._material._uniformBufferLayoutBuilt) {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
this._material.resetDrawCache();
|
|
35
|
+
this._material._createUniformBuffer();
|
|
36
36
|
}
|
|
37
37
|
if (!plugin.isCompatible(this._material.shaderLanguage)) {
|
|
38
38
|
// eslint-disable-next-line no-throw-literal
|