I have already asked for help on dynamically changing the color of a material based on a z-threshold, and I succeeded with a material without textures, by specifying one color for the part of the object above the threshold and another for the part below, and it works. However, I also want to reproduce this in more complex materials, with textures.
If I do as shown in the following figure (“Code” screen), or as I did for materials without textures, my rock looks like the photo below (“Result” screen), which is too black and too white.
The result I would like is for the rock to be its original color at the top, which is achieved by connecting the Input Albedo node directly to the base color. (“Base Color” screen)
And at the bottom I would like it to be a little darker, which is achieved by connecting the output of the Power node directly to the BaseColor.(“Little bit darker” screen)
I don’t understand why the colors change so much when using Lerp… shouldn’t the final color be between the input in A and the input in B? The two inputs, as mentioned and seen from the previous photos, are correct when taken individually and applied to the BaseColor… but maybe I’m doing something wrong.
Maybe there is a better way to create the 2° color (“a little bit darker” screen)?
EDIT
I realized that there is a simple way to create the “Little bit darker” version, by multiply the input albedo with a 3vector. I obtained the same “little bit darker” version, but also the same “result” if i put the output of multiply into Lerp…