hello, I don’t know if it’s a bug and it’s super weird cause it only happens on chrome and not firefox.
webGLPipelineContext.js:296 Uncaught TypeError: Cannot read properties of undefined (reading ‘world’)
at WebGLPipelineContext.setMatrix (webGLPipelineContext.js:296)
at Effect.setMatrix (effect.js:964)
at ShaderMaterial.bindOnlyWorldMatrix (shaderMaterial.js:664)
at ShaderMaterial.bind (shaderMaterial.js:693)
at Mesh.render (mesh.js:1928)
at SubMesh.render (subMesh.js:358)
at RenderingGroup.renderUnsorted (renderingGroup.js:205)
at RenderingGroup.render (renderingGroup.js:105)
at RenderingManager.render (renderingManager.js:87)
at MultiRenderTarget.RenderTargetTexture.renderToTarget (renderTargetTexture.js:834)
in the debugger:
/**
* Sets matrix on a uniform variable.
* @param uniformName Name of the variable.
* @param matrix matrix to be set.
*/
WebGLPipelineContext.prototype.setMatrix = function (uniformName, matrix) {
if (this._cacheMatrix(uniformName, matrix)) {
if (!this.engine.setMatrices(this._uniforms[uniformName], matrix.toArray())) {
this._valueCache[uniformName] = null;
}
}
};
In my code if I remove world:
const material = new ShaderMaterial(
name,
scene,
{
vertex: "main",
fragment: "main",
},
{
attributes: ["position", "normal", "modelViewMatrix"],
uniforms: [
// "world",
"viewProjection",
"lightMatrix0",
"ambiant",
"diffuse",
"ambiantDark",
"diffuseDark",
"mapSize",
],
uniformBuffers: ["Light0"],
samplers: ["shadowSampler0"],
defines: [
"#define SHADOWS",
"#define SHADOW0",
"#define LIGHT0",
"#define SHADOWFLOAT",
],
}
);
it complains for viewProjection.
Obviously this._uniforms seem to be undefined in WebGLPipelineContext.
Any lead of investigation?
I might try to reproduce it in the playground if you have no clue.