Problem with RGBA channel masking function

Hi,

I had created a material that takes a mask texture plus 3 diffuse textures and blends them together accordingly:

631b47205cad221a64a6d18a72a59ab1208ee215.jpeg

To make it a bit more modular, I made the blending part into a function:

fd6d96721b1058b8478a58b15722ad6e6fb59ede.jpeg

Now it is very convienient to assign the textures for instances:

1ac164ac69a88bb341181376fc09ba84b738a1da.jpeg

And now I tried to do the same with and RGBA texture so I can blend 4 different textures into the material, but thats where teh problem starts:

Why do I get an error and why are the lerps all blank?
faf15073623765f16f2f99cd0f2fcd54e08bcab3.jpeg

If I set it up just as a material, it works…

1847f2182312508a963141189806dd64afab6f50.jpeg

What am I doing wrong? :confused:

Cheers,
Klaus

You need to append the alpha channel to the RGB output of the mask texture to actually make it float4.

Hi,

Thanks for the tip :slight_smile:
Somehow I thought the white pin already includes the alpha. Strangely it didnt give me an error then when i hooked a v3 output to a v4 input…
Now with the append, the function works.

3636821a003b470d1d1f5ce5a8d53679e7a7f4e0.jpeg

However, the material does not seem to like the output though:

f3dc746990dd2afe4730af88034ffdd2f6f38468.jpeg

What does the base color node wants?

Cheers,
klaus

Same issue again, you are passing a float3 to the material function whilst it should be float4.

Ah, you mean the mask texture as function input…
What added to my confusion is the fact that the error is not raised until you connect the function output to something:

d7ad838bfe989b4e3a53a44a2463f465b9f5fa50.jpeg

So when I hooked the output of the function to the base color, it gave me the error, suggesting the base color inpuit does not like the function output… :rolleyes:

It works now :cool:

Thanks again :wink:

Ahhhh… The joy came too soon. :frowning:

Now I must be doing something really stupid… Iguess… :confused:
I create a parameter for the material, and its not showing up in the instance editor:

The boolean parameter on the switches allow the artist to either assign a texture or paint the channel area with the “DisableColor”.
All the parameters for the textures and the booleans show up in the instance editor, but theis vector parameter just wont…

6897bf68cfea5e2a84eb56b91b971703509341dd.jpeg

When I put it into another parameter group, say “masking”, its not showing up:

292dbfcbece9285b08d36ca2f06adf7477cc6de8.jpeg

27ddafe523cc1057214c47c05a1fa6477d9e2355.jpeg

If I create an own group for it:

68aeea6225167f8563a3efabe0f5d5531eb4c703.jpeg

The group appears, but the parameter doesnt…

How did I screw up this time?:rolleyes:

Cheers,
Klaus

It’s probably not showing up because your bool parameters are set to false.

Yepp. Absolutely correct. I didnt expect that kind of behaviour. :rolleyes:
So all the parameters that are brigded off by a currect switch setting, disappear from the instance editor properties panel. :o