2
$\begingroup$

I'm using a transparent image texture of humans on a plane for architectural scenes. Before I load the image to the Image Texture Node, I change the opacity in Gimp, like 50%, so that you can see through just a little bit. But I wonder if there is a simple way to do this in the node setup instead of Gimp?

I have search but I just find tutorials about how to use transparent images, but that I already know about.

This is the node setup I'm using:

enter image description here

$\endgroup$
  • $\begingroup$ To do what you're currently doing in Gimp, you would simply need to disconnect the Alpha link from the Factor and manually set the Factor to 0.5. That should give you 50% Transparent and 50% Diffuse. Make sure the Transparent node is pure white. $\endgroup$ – bertmoog Jul 24 '17 at 14:42
  • $\begingroup$ @bertmoog Thanks for the reply. When I disconnect the alpha from the Factor, the transparent areas around the human in the image, become black! $\endgroup$ – 3D-kreativ Jul 24 '17 at 14:52
  • $\begingroup$ @MrZak Thanks for the reply. The area around the human is already transparent and not visible. I want to change the opacity of the human, the part in the image that isn't transparent. $\endgroup$ – 3D-kreativ Jul 24 '17 at 14:54
  • $\begingroup$ I think it was meant that you need to add one more Tranpsarent shader to the tree before one with Alpha factor and set mixing of it and Diffuse to 0.5. $\endgroup$ – Mr Zak Jul 24 '17 at 14:58
  • $\begingroup$ @MrZak I'm trying all kinds of combinations, but nothing works! Should I add a new Diffuse node and a new Transparent node and then a new Mix node? Then...where do I connect them? $\endgroup$ – 3D-kreativ Jul 24 '17 at 15:12
7
$\begingroup$

Let's say you have an image with an alpha channel:

enter image description here

Which in turn, is nothing but a mask: an image with a black and white channel that determines the opacity of the RGB information. Black (0) is considered transparent, white (1) opaque.

enter image description here

If one were to use the image as color for the texture we get an opaque texture, because the alpha channel is not being used, just the RGB information.

enter image description here

Adding a transparent shader and using the alpha information to control the mix will make the black (0) pixels of the alpha channel be transparent and the white ones opaque (1).

enter image description here

To change the opacity of the alpha channel, you would need to make the white areas darker. To do that thre are quite a few options:

using a MixRGB node, multipy the alpha channel image with a black (0) color , that way the white areas of the mask (or alpha channel) will be less opaque.

By changing the value mix factor you'll get different degrees of opacity.

enter image description here

Alternatively you can subtract white (1) from the values of the alpha channel and get the same effect.

enter image description here

Using a math node with the multiply operation will also give you the same control by using values between 0 and 1:

enter image description here

Using a Bright Contrast Node with negative numbers for brightness will also have the same effect.

enter image description here

Or it can also be done with RGB curves

enter image description here

Or if you don't want to alter the values for the alpha channel for whatever reason, a different alternative is to use another mix shader and plug the result of the previously shown shader and mix it again with a transparent shader. Changing the fac values will change the opacity.

enter image description here

$\endgroup$
2
$\begingroup$

You can insert "math" node between Texture alpha output and Mix shader Fac input.

Alpha 0 = full transparency. Use math node to add 0,5 and results is 50% transparency.

EDIT: optionally you can use ColorRamp, Bright Contrast, Gamma, RGB Curves to tweak values. Or you can use MixRGB and mix alpha channel with other grayscale color using different blending modes.

enter image description here

$\endgroup$
  • 1
    $\begingroup$ Possible alternatives betwen the Alpha socket and the Mix Shader Fac are: Color>BrightContrast, Color Ramp, Math nodes, RGB curves Gamma and MixRGB. They all do different things but they will allow you all the control you want on the mix between two shaders using an alpha map. $\endgroup$ – cegaton Jul 24 '17 at 15:19
  • $\begingroup$ Thanks for the answer! But it's not the transparency value I want to change. If I use and Math node, the not visible areas of the image goes from fully transparent to darker and darker and finally total black. I just wnat to change the visible part of the transparent .png image and change the opacity of that part. Perhaps not possible!? $\endgroup$ – 3D-kreativ Jul 24 '17 at 15:32
  • $\begingroup$ @cegaton Yes, you are right. Thanks for addition, I add it to my answer :-) $\endgroup$ – Shubol3D Jul 24 '17 at 15:33
  • $\begingroup$ @3D-kreativ - depend on the case. Also there is option paint alpha mask manually, and combine them if need. You can do it directly in Blender. Alpha is nothing else than values from 0 to 1. Grayscale image is the same. So you can tweak it like image and you can tweak it a lot. But of course, you can't change initial shape without editing original image/alpha or combine it with other one $\endgroup$ – Shubol3D Jul 24 '17 at 15:42
  • 2
    $\begingroup$ It is perfectly possible to do in blender and avoid the horrible tool called Gimp... Please update your question with the relevant information $\endgroup$ – cegaton Jul 24 '17 at 18:50

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.