1
$\begingroup$

My question is - how to create a shading setup that will smoothly interpolate between full opacity to full transparency. I'm trying to do this on a simple plane with somewhat partial results.

enter image description here

In the image above you can see that the rendered image is partly invisible only on the background of a different plane, and not where the scene background is. Is there a way to solve it so that I have alpha everywhere?

What I simply want to achieve is a linear gradient from one color, to a transparency, something like that:

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Please define your goal in more detail. What do you mean by "smoothly interpolate"? In what context? Is it in a period of time, or specific axis in space or should there be a slider, or something else? What are you trying to achieve? Please provide some context so that good people trying to help you do need to waste their time on misunderstandings. $\endgroup$ – Martynas Žiemys Sep 7 at 15:00
  • 1
    $\begingroup$ In this case the transparency is controlled by the mix shader node at the end of the chain. The fac value will determine the mix between transparent and the bsdf. But note that you don't need the transparent node at all (or the mix shader node conected to it) just plug in the transparency values you want to the alpha input of the principled BSDF $\endgroup$ – susu Sep 7 at 15:01
  • 1
    $\begingroup$ @MartynasŽiemys I made an edit to clarify what I mean. $\endgroup$ – luke1985 Sep 7 at 15:13
  • 1
    $\begingroup$ As said by @susu, as your node setup is, the surface will be half transparent all the way. Just plug the multiply output to the alpha of the principled and remove mix and transparency shaders. $\endgroup$ – lemon Sep 7 at 15:35
0
$\begingroup$

Your issue is that you are applying the gradient to the color of the transparent shader, instead of using it to control how the two shaders are mixed. Since your factor slot is empty, they are just being mixed with a factor of 0.5 across the whole surface.

My result: result

The nodes:

nodes

Explanation

To transition from a color to transparent, you essentially want to mix the two shaders, here a transparent BSDF and an emission shader, with the mix factor increasing along the gradient. For a simple gradient along the X axis, I used a color ramp, but you could apply the same process with any other gradient texture. Here, I want a value from 0 to 1 along the color ramp based on the X position on the object, so I plug in the X component of the Object coordinates as the factor to the color ramp, and use that to control the mixing.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.