Procedural Texture Defines?

Do we have a way to compile a ProceduralTexture with custom defines?

Ive noticed on the actual code the _getDefines() => return "" which looks like they are disabed then?

_getDefines is meant to be overriden by a class you write that would subclass ProceduralTexture. That way you can pass your own defines, as the returned value from _getDefines is passed to the createEffect call.

So instead of doing just a new ProceduralTexture(...) I should be doing class CustomTexture extends ProceduralTexture{...}?

and then the getDefines would be returning something like

return "#define IMADEFINE 0"

?

update
works like a charm!
thanks.

https://playground.babylonjs.com/#HWG227#3

1 Like