I am creating a rather large material at the moment, and am running into some issues now that I have increased the number of parameters. Does anyone know whether there is a hard limit on the parameter count? Searching the doc’s & forums I can not seem to find any info on .
Also along these lines, I have already discovered a limitation of 2 MaterialParameterCollection’s per material, but is there a limit on the number of values in a MPC?
I am currently attempting to use one of the following:
35 Scalar parameters
37 Vector parameters (all 4 channels are used for 32 of these, 2 or 3 channels used for remaining 5)
Beyond the parameters, there are 4 calls to a large function that itself calls another function 8 more times.
I know the quantity is a little bit insane, but the majority are hid by switches and only used in certain circumstances. I am not worried about performance here, everything runs incredibly fast considering everything, and also the parameters are really only being used to fine tune values before they become constants, but it seems as though I have hit some limit here as my material is behaving extremely odd. I have spent all day double checking everything, I simply copied and pasted the original (working) displacement calculations 3 times, adjusted the param names, and plugged it all in.
Aww man! I was almost hoping I had reached the limit - Only because I’m getting a headache from re-checking each parameter and its wire over and over.
Worst part is, I bypass all of the new nodes I created to make it go back to the way it was, and still I am getting the same bizarre result. I would post it here if it wasn’t so huge, but I guess it’s time to pull a backup.
lol…i couldnt even fit those parameters you mentioned into my imagination so i can understand your frustration.
It just occurred to me, can static switches you have be the reason?: .unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Parameters/index.html#staticswitchparameter
I also thought that could be the case when I read that, as I did have StaticBool parameters plugged into a set of switches to enable / disable each set. However I bypassed all the switches and tried only using the original working wave set plugged it into the material, but nothing changed.
I guess I won’t be able to use the bool anymore after it starts to work again (as I am driving from a blueprint as well). I also bypassed the blueprint and just applied the material to a plane, still the same results.
It is really odd, but for now I am going to strip out the added nodes and get my single wave set working again.
Oh I just thought of something, I’m going to flush the shader cache, I read the other day someone having an with a material they created suddenly not working with being the fix, might be worth a try.
On bools and switches, cant you use Lerp instead of them? Plug a scalar parameter to alpha and set A and B with an integer in the BP(1=A, 0=B) It will mean some more parameters eventually but at least you wont be restricted with switch parameters. I dont know how/if it affects the instruction count though.
Oh that’s right, thanks for reminding me! I was just trying to figure out a way to add them in again, even though I already use that technique in the SAME material, it never crossed my mind… I think I better take a break soon.
I did get my initial wave set working again (did not flush the shaders), by adding all of it’s parameters into the param collection, I had been using a mix of material parameters and a parameter collection at the same time. I have no clue why it wouldn’t work with the Vector parameters in the material, but moving them into the material collection fixed it. Really strange…