NoiseProceduralTexture render function errors

The following code errors on line 100 with this._drawWrapper.effect is null: Babylon.js Playground

Could someone tell me how do I cause the NoiseProceduralTexture to render so that it can be sampled please? (Its data is then hopefully transformed into another data object suitable for use with the BABYLON.MeshBuilder.CreateGround’s updateVerticesData function). Thank you.

You need to wait for the texture to be ready before rendering (means the effect has been compiled) https://www.babylonjs-playground.com/#ZH0IX6#2

Also readpixels will read the full buffer not a single pixel so you will need to rework this part.

2 Likes

Thank you @sebavan !

For anyone following on from this I got the mesh modification working, as well as updating the normals, and setting a directional light so the terrain variations can be seen more easily: https://www.babylonjs-playground.com/#ZH0IX6#3

1 Like