Does unused inputs to ShaderStore affect the performance?


I need clarification on Effect.ShaderStore. I need to toggle between to setups in my project and one of the setup require the shader file and the other one doesn’t. The challenge I face is to add the file in ShaderStore after the engine start running. If I load the file initially to the shaderStore, even if I didn’t use it, everything works as expected.

To show how I add the file
BABYLON.Effect.ShaderStore["ssao2PixelShader"] = '...shader file...'

So my questions are

  1. Is it acceptable logic to add the file after the engine start running?
  2. do I need to toggle the file? what is the effect of loading the file initially? does it have an impact on the performance if it is loaded at the beginning?
  3. Is there a way to handle this task?

Thank you in advance.

  1. No problem at all. It is all good
  2. Only impact is the me
  3. you all good :wink:

The system is smart enough to optimize it :wink: