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? Also did I manage to confuse myself again or are the docs lagging a bit?