Creating color from 4 floats
Posted: Wed Jun 21, 2017 8:48 pm
Hello,
Amplify has so far proven to be a good basis for building up some shader skills, thanks for providing this product. I've now hit a bump I was hoping you could help me with.
I am using the RGBA channels of different textures and running separate mathematical functions on each channel using shader functions. These functions output a float (per channel). I want to re-assemble these channels into a color that goes to the Albedo, but I cannot seem to find a node that takes in 4 floats and outputs a "Color" or "float4".
Here's what I'm trying to do in pseudocode:
Does such a node exist? Or am I misunderstanding the variable type that goes into the albedo node?
Thanks for helping me out..
TY
Amplify has so far proven to be a good basis for building up some shader skills, thanks for providing this product. I've now hit a bump I was hoping you could help me with.
I am using the RGBA channels of different textures and running separate mathematical functions on each channel using shader functions. These functions output a float (per channel). I want to re-assemble these channels into a color that goes to the Albedo, but I cannot seem to find a node that takes in 4 floats and outputs a "Color" or "float4".
Here's what I'm trying to do in pseudocode:
- Code: Select all
float4 assembledAlbedo = float4 (0, 0, 0, 0);
assembledAlbedo.r = SomeShaderFunctionR(text1.r, text2.r);
assembledAlbedo.g = SomeShaderFunctionG(text1.g, text2.g);
assembledAlbedo.b = SomeShaderFunctionB(text1.b, text2.b);
assembledAlbedo.a = SomeShaderFunctionA(text1.a, text2.a);
Does such a node exist? Or am I misunderstanding the variable type that goes into the albedo node?
Thanks for helping me out..
TY