# BJS 4.1.0 and detailMap of StandardMaterial

**URL:** <https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093>\
**Category:** Questions\
**Created:** [August 3, 2020, 8:01pm UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093 "2020-08-03T20:01:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbase](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dbase/32/9431_2.png) [@dbase](https://forum.babylonjs.com/u/dbase)\
**Post date:** [August 3, 2020, 8:01pm UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093/1 "2020-08-03T20:01:14Z")

</div>

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:

```javascript
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](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](https://doc.babylonjs.com/how_to/more_materials).

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

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 3, 2020, 9:29pm UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093/2 "2020-08-03T21:29:22Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![dbase](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dbase/32/9431_2.png) [@dbase](https://forum.babylonjs.com/u/dbase)\
**Post date:** [August 3, 2020, 10:20pm UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093/3 "2020-08-03T22:20:42Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 3, 2020, 10:45pm UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093/4 "2020-08-03T22:45:14Z")

</div>

I’ve just pushed alpha 29  
it should be fixed 😃

---

<div class="post-metadata">

**Author:** ![dbase](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dbase/32/9431_2.png) [@dbase](https://forum.babylonjs.com/u/dbase)\
**Post date:** [August 4, 2020, 1:12am UTC](https://forum.babylonjs.com/t/bjs-4-1-0-and-detailmap-of-standardmaterial/13093/5 "2020-08-04T01:12:39Z")

</div>

Awesome thanks @Deltakosh 🙂
