# Procedural Texture Generated by Export

**URL:** <https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639>\
**Category:** Questions\
**Created:** [July 22, 2023, 2:53pm UTC](https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639 "2023-07-22T14:53:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RainerHeintzmann](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rainerheintzmann/32/32692_2.png) [@RainerHeintzmann](https://forum.babylonjs.com/u/RainerHeintzmann)\
**Post date:** [July 22, 2023, 2:53pm UTC](https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639/1 "2023-07-22T14:53:58Z")

</div>

Using the playground from the documentation of procedural textures, I just pressed “Export Code” and tried to generate the same texture in the code:

> **[Babylon.js Playground](https://playground.babylonjs.com/#8S19ZC%2344)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

However, this yields an error:  
“Incompatible material mode”  
and the texture silently fails.  
Indeed, if you open the Node editor the mode is “Texture”. What does one need to do to get the mode back to “Procedural”? It may be helpful if that missing line is somehow included in the code, when exporting it.

---

<div class="post-metadata">

**Author:** ![RainerHeintzmann](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rainerheintzmann/32/32692_2.png) [@RainerHeintzmann](https://forum.babylonjs.com/u/RainerHeintzmann)\
**Post date:** [July 22, 2023, 3:02pm UTC](https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639/2 "2023-07-22T15:02:56Z")

</div>

I found the missing line by playing around:  
`nodeMaterial.mode = BABYLON.NodeMaterialModes.ProceduralTexture;`  
Seems to do the trick. Here is the playground:

> **[Babylon.js Playground](https://playground.babylonjs.com/#8S19ZC%2348)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<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:** [July 24, 2023, 11:03am UTC](https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639/3 "2023-07-24T11:03:42Z")

</div>

This PR will add the code for the “mode” property:

> <https://github.com/BabylonJS/Babylon.js/pull/14079>
>
> See https://forum.babylonjs.com/t/procedural-texture-generated-by-export/42639
