Hey all. What I'm trying to get done is basically a Lerp between three textures. For the sake of discussion, assume we're talking about unreal, as our engine's material creator has similar nodes.
My problem is that Lerp usually supports just 2 nodes. The material gets fed a variable that goes between 0..1 range. I need 0 to be TextureA, 0.5 to be TextureB, and 1 to be TextureC.
Anyone has any idea as to how to pull it off?
Replies
----( 0 - .5 )LERP_NODE--|
|---- texA
| ---- texB
|
|
value01(0-1)---|LERP_NODE
|
|
|
----( .51 - 1 )LERP_NODE--|
---- texB
---- texC
maybe thats not what youre after, but hope it helps.
*edit: lost all the formatting... Basically you use one node to control the blend between two others. And for each of the two others, you blend betrween a-b and b-c.
At 0.5 I would expect it to be fully blue (the center color), but instead it blends between all 3.
Hope I'm clear.
i've had a quick play with using multiple lerps and come up with something that's pretty close.
the attached udk network should blend nicely between blue and red from 0-0.5 and then from red to green from 0.5-1 but for some reason the centre path isnt working. the output value from the second 1-x node should be 0 (and does indeed look black) but doesn't work correctly when connected into lerp2. it might just be a quirk of UDK or something though so have a try in your engine. if you just need a switch between 3 textures if you just connect the variable directly into lerp2 that should work correctly for 0, 0.5 and 1.
just checked and if you change the centre multiply from 50 to 49.9 it works fine. obviously some sort of rounding error that close to zero or something.
tharle
if you want, I can email you the material if you cant reproduce it. either way, hope this helps!