Automatically store shader in shader store after grabbing it as a path

Currently, we use a path to a file to load a custom shader onto our materials. However, just realized this ends up making a network call (albeit a small one) every time. Is there a way that babylon can auto-store the result of
this._engine._loadFile(shaderUrl + "." + key.toLowerCase() + ".fx", callback);
In the shader store after loading it in effect.ts?

Engine will not make that assumption

But maybe I misunderstood the ask, can you share a repro in the PG to see what we are talking about?

I think we’re on same page. Understand that it didnt want to make an assumption, but wasnt sure if there was a flag somewhere i was missing that could tell the engine that it should make that assumption.

No worries, its easy enough for me to load them into the shaderStore manually at the beginning, just wanted to make sure there wasnt a flag i was missing somewhere

1 Like

Careful with this. You are calling a function with an underscore in front which means it’s private. You should avoid calling this function since it’s not part for the public API and can change or be removed at any time. The intended way to load files in Babylon.js is with Tools.LoadFile.

1 Like

Oh, i wasnt going to call that function, i was suggesting that maybe as part of babylon it might be useful to store the result in shader store. I’m not directly calling that function, its part of the effect.ts code.