Hey, I noticed an issue with our landscape material that seemed to receive only one (grass) landscape layer info (we have 8 + rocky wall thing). On further inspection it was not only about landscapes, it affected many other materials as well. I tried to look for info about it but as 4.26 issues are fairly new I had to debug it a bit on my own and this is what I found out:
If you have Material functions that have same parameter naming (Diffuse/Normal/Roughness/etc) it seems like the “first in line” will be used for the rest of them. In 4.25 every material function used different instance variable, but now they get merged in unexpected way. Even using the group does not fix the issue. We had to rename the parameters in each function to make it work, but that solution wouldn’t scale up.
What you are saying makes no sense on so many levels.
in a function you should use an input and a default value for that input. Not scalar parameters. To avoid errors like the one you are showing.
parameters with the same name get consolidated because they are in fact the same variable - regardless of what function they can also be found in.
A Scalar inside the main material will override the same parameter values set by functions (same for any variable type).
if you name different parameter types with the same name you cause mayhem.
For me that happened with switch parameters called Normal and the texture sample parameter called Normal as well for instance.
Anyway, point is, you need to re-work your materials and make Inputs for the functions to which you pass an actual value.
using scalar params inside functions isn’t completely wrong, it’s actually desireable in some cases (when you actually want one single param to control several instances of a function)
you’re spot on for the rest though.
unless this setup is for Material Layers. in that case using the same variable names is expected and desired.
sadly Material Layers are not compatible with Landscape. so yeah, the material needs to be reworked
Thank you for the response. I had to remove some of the unnecessary pictures, something went wrong with the post.
I will definitely (try to) fix these materials I was wondering if there was anything other that should be taken into consideration.
These materials had worked in previous versions. Would have not even found them unless they would have suddenly broken.
(to be noted: materials were not made by me)
If they worked in the previous version, then it was probably just by accident/coincidence. In general, all you really need to take into consideration is just to make sure there aren’t multiple material parameters sharing same name within one material, and this includes entire hierarchy of the material, so even material functions, and even material functions used in those material functions, etc…
It’s fine to have multiple material parameters of the same name within one material, but only if you intend all of them to be changed to the same value at the same time. You can think of it more or less same as having multiple copies of a get node of the same blueprint variable, except that material editor UI currently doesn’t have any kind of existing variable list, unlike BP editor (aside from material parameter defaults panel).
That being said, I agree that this is a bit confusing. I think Unreal’s material editor could benefit from similar management of the variables to the blueprint editor.