Procedural textures are not assignable per documentation

When following the docs to use procedural texture run into errors immediately upon assigning the texture to a material.

import { FireProceduralTexture } from "@babylonjs/procedural-textures/fire";
...
const efxMat = new StandardMaterial("efxMat", this.scene);
const fire = new FireProceduralTexture("firePT", 256, this.scene);
efxMat.diffuseTexture = fire;

Yields…

Type 'FireProceduralTexture' is not assignable to type 'BaseTexture'.
Types of property 'getTextureMatrix' are incompatible.
Type '() => import("/home/delaney/work/node_modules/@babylonjs/core/Maths/math").Matrix' is not assignable to type '() => import("/home/delaney/work/app/commander/frontend/node_modules/@babylonjs/core/Maths/math").Matrix'.
Type 'import("/home/delaney/work/node_modules/@babylonjs/core/Maths/math").Matrix' is not assignable to type 'import("/home/delaney/work/app/commander/frontend/node_modules/@babylonjs/core/Maths/math").Matrix'.
Types have separate declarations of a private property '_isIdentity'.

Hopefully its just a documentation issue.

Seems like you may have a version mix up. Can you make sure that all your references point to the same version of babylon.js ?

It appears the @babylonjs/procedural-textures got added at the wrong dir level, thanks @Deltakosh

1 Like