Force CustomProceduralTexture to recompile from new shader string

So lets say I have a custom procedural texture that I spin up with certain code then later I need to modify the actual shader string for this texture.

Is there a way to force the texture to recompile from the code in the ShadersStore that it originally referenced without disposing and recreating?

Figured that the bind is called every frame so maybe prior to that there would be a way to inject the code in but Im not too sure.

I thought setFragment would do it, but it seems to not.

Why does changing the string in the shade store then doing a new instance of the texture not work? Is there something cached?

I think the reset method should do it, so here’s a PR:

In the meantime, you can do it like this:

Once the PR is merged, calling reset will be enough.


I kinda thought that’s what reset was supposed to do, but it was borked when I tried! Thanks for the fix.