BJS 4.1.0 and detailMap of StandardMaterial

I just upgraded to 4.1.0 (I don’t know how/why I was on a previous version!). As I was compiling I got a complaint about detailMap which I was previously editing like so:

const material = new StandardMaterial('AM', this._scene);
material.emissiveColor = Color3.White();
material.roughness = 1;
// Apply different effects based on substrate
switch (type) {
  case Substrate.Canvas:
    material.diffuseTexture = new Texture(url, this._scene);
    material.detailMap.isEnabled = true;
    material.detailMap.texture = new Texture(
      `${this.assetBase}/textures/substrate_canvas.png`, this._scene
    );
    material.detailMap.texture.uScale = 3;
    material.detailMap.texture.vScale = 3;
    material.detailMap.diffuseBlendLevel = 0.4;
    material.detailMap.bumpLevel = 0.5;
    this.disableLighting();
}

Now I’m getting an error on it. The docs state that the value is readOnly: https://doc.babylonjs.com/api/classes/babylon.standardmaterial#detailmap. Some other docs are modifying the value: Apply Bumps, Opacity, Tiling and Detail Maps - Babylon.js Documentation.

According to the release notes, nothing was recorded as changing (which confuses me more). The question is how do I set a DetailMapConfiguration? :slight_smile: Also did I manage to confuse myself again or are the docs lagging a bit?

DetailMap is a new feature in 4.2, it is not available in 4.1.

Note that the detailMap object itself is read only, but not the properties of this object (texture, diffuseBlendLevel, etc).

You know what, I messed up. That’s super weird I must have accidentally reverted my BJS version and not even realised it. I was on alpha-23 and now I’m on alpha-28. The detailMap works as expected although I’m getting a new error related to pointer:

index.js:776 Uncaught TypeError: Cannot assign to read only property 'pointerId' of object '#<PointerEvent>'
    at HTMLCanvasElement._onPointerMove

Looks like a bug in alpha28, I’ll revert back.

You can kindly ignore me now :-p

I’ve just pushed alpha 29
it should be fixed :smiley:

Awesome thanks @Deltakosh :slight_smile: