|
@@ -1199,7 +1199,7 @@ export class StandardMaterial extends PushMaterial {
|
|
"reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler",
|
|
"reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler",
|
|
"refractionCubeSampler", "refraction2DSampler", "boneSampler"];
|
|
"refractionCubeSampler", "refraction2DSampler", "boneSampler"];
|
|
|
|
|
|
- var uniformBuffers = ["Material", "Scene"];
|
|
|
|
|
|
+ var uniformBuffers = ["Material", "Scene", "Mesh"];
|
|
|
|
|
|
DetailMapConfiguration.AddUniforms(uniforms);
|
|
DetailMapConfiguration.AddUniforms(uniforms);
|
|
DetailMapConfiguration.AddSamplers(samplers);
|
|
DetailMapConfiguration.AddSamplers(samplers);
|
|
@@ -1322,7 +1322,6 @@ export class StandardMaterial extends PushMaterial {
|
|
ubo.addUniform("vRefractionInfos", 4);
|
|
ubo.addUniform("vRefractionInfos", 4);
|
|
ubo.addUniform("vSpecularColor", 4);
|
|
ubo.addUniform("vSpecularColor", 4);
|
|
ubo.addUniform("vEmissiveColor", 3);
|
|
ubo.addUniform("vEmissiveColor", 3);
|
|
- ubo.addUniform("visibility", 1);
|
|
|
|
ubo.addUniform("vDiffuseColor", 4);
|
|
ubo.addUniform("vDiffuseColor", 4);
|
|
|
|
|
|
DetailMapConfiguration.PrepareUniformBuffer(ubo);
|
|
DetailMapConfiguration.PrepareUniformBuffer(ubo);
|
|
@@ -1374,10 +1373,10 @@ export class StandardMaterial extends PushMaterial {
|
|
}
|
|
}
|
|
this._activeEffect = effect;
|
|
this._activeEffect = effect;
|
|
|
|
|
|
- // Matrices
|
|
|
|
- if (!defines.INSTANCES || defines.THIN_INSTANCES) {
|
|
|
|
- this.bindOnlyWorldMatrix(world);
|
|
|
|
- }
|
|
|
|
|
|
+ // Matrices Mesh.
|
|
|
|
+ mesh.getMeshUniformBuffer().bindToEffect(effect, "Mesh");
|
|
|
|
+ mesh.transferToEffect(world);
|
|
|
|
+
|
|
|
|
|
|
// PrePass
|
|
// PrePass
|
|
this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
|
|
this.prePassConfiguration.bindForSubMesh(this._activeEffect, scene, mesh, world, this.isFrozen);
|
|
@@ -1512,9 +1511,6 @@ export class StandardMaterial extends PushMaterial {
|
|
ubo.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha);
|
|
ubo.updateColor4("vDiffuseColor", this.diffuseColor, this.alpha);
|
|
}
|
|
}
|
|
|
|
|
|
- // Visibility
|
|
|
|
- ubo.updateFloat("visibility", mesh.visibility);
|
|
|
|
-
|
|
|
|
// Textures
|
|
// Textures
|
|
if (scene.texturesEnabled) {
|
|
if (scene.texturesEnabled) {
|
|
if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
|
|
if (this._diffuseTexture && StandardMaterial.DiffuseTextureEnabled) {
|