I’ve noticed that while static switch params will enable/disable the branch inputs in a material instance, the actual shader in the editor doesn’t seem to recompile the switched branch in the editor.
If I enable the desaturation branch of my shader the options for it appear, but the shader itself never performs any desaturation. Using a scalar param and a lerp instead however works fine but isn’t ideal from an optimisation perspective.
I set up a test (which I hadn’t done yet) and while it crapped out at first after a couple of toggles it actually worked as expected. The shader I originally tried it on is quite large - does it need to generate and cache all of the potential states before it works smoothly?
Yes, Technically all MIC are just a copy of that whole original shader and the whole shader must be loaded into memory before the shader is registered. Usually this happens close to instantly, but can take a moment if you are dealing with a complicated network.
I’m still definitely seeing a problem on larger shaders. I’ve uploaded a sample project here:
If you open the material instance ContentBrowser/CelShaderAnime you’ll see a param group called Saturation. If you enable this branch and set the saturation level to 0, nothing happens, the instruction count goes up but the controls do nothing to the editor viewport. Setting the “Saturation” value to zero SHOULD enable that branch and desaturate the scene.
The switches themselves are located in Shaders/CelShader/CelShader.uasset
There is currently a known issue with using MIC’s in Post Process Blendables. I will keep you informed as we work on the issue and I have linked this AnswerHub post to our bug report.
It is listed as TTP#344222 and is assigned and currently open so not immediately but probably not next year either. That is about as precise as I can get.
No, our bug trackers are not public but I wanted to be able to have a direct reference to the issue in the future. As far as the year goes, I was being hyperbolic, but please understand I have no control over the order of issues that our engineers address.
I didn’t expect you had any control over it - I was only after a timeframe as it affects when I’ll do a marketplace submission. If it’s not scheduled for the foreseeable future I’ll stop waiting and go ahead and submit with a workaround in place.