Mix Texture and images with alpha channel

Forums: Mix Texture and images with alpha channel
Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)

Mix Texture and images with alpha channel

Postby Andreas_Resch » Thu May 18, 2023 2:41 pm

Andreas_Resch Thu May 18, 2023 2:41 pm
I'm stuck at what seems to be a trivial task. I want to put a transparent image (TIFF with transparency) on top of another texture. I tried using a Mix Texture node and fed the Texture Out socket into the "Second Texture" socket as well as the "Amount" socket. But the result doesn't look correct. The only way I can get it two work is to load the image twice, once into an RGB image node and then again into an Alpha Image node. But that can't be the best way to do it, having to always have to create two nodes for the same image. I've seen some older tutorials on Youtube where they do that. But surely there have been some changes in the meantime. Has anybody got a solution?

Alpha_01.jpg


In Blender I can connect the Alpha socket of the image to the Factor, which makes sense.

Alpha_02.jpg
Andreas_Resch
 
Posts: 269
Joined: Sat Jul 28, 2018 6:29 am

Re: Mix Texture and images with alpha channel

Postby elsksa » Thu May 18, 2023 3:44 pm

elsksa Thu May 18, 2023 3:44 pm
Hi,
The composite material comes handy. A quick demo:
Image
Attachments
octane_QQFBxAfGow.gif
Last edited by elsksa on Thu May 18, 2023 3:46 pm, edited 1 time in total.
elsksa
Licensed Customer
Licensed Customer
 
Posts: 784
Joined: Sat Jul 24, 2021 1:06 am

Re: Mix Texture and images with alpha channel

Postby elsksa » Thu May 18, 2023 3:45 pm

elsksa Thu May 18, 2023 3:45 pm
Or the other way around.
elsksa
Licensed Customer
Licensed Customer
 
Posts: 784
Joined: Sat Jul 24, 2021 1:06 am

Re: Mix Texture and images with alpha channel

Postby Andreas_Resch » Thu May 18, 2023 3:48 pm

Andreas_Resch Thu May 18, 2023 3:48 pm
Hmmm. I'm not sure I can follow that. For one you seem to mix materials. I want to mix textures. And then there's a node where the opacity is stored in a red channel (?). I haven't got any opacity stored in any of the color channels. I have a TIFF file with transparency included.
Andreas_Resch
 
Posts: 269
Joined: Sat Jul 28, 2018 6:29 am

Re: Mix Texture and images with alpha channel

Postby elsksa » Thu May 18, 2023 4:09 pm

elsksa Thu May 18, 2023 4:09 pm
My bad. It's the same principle with the equivalent node for texture files:

Image
Attachments
octane_UnKhrGs70d.gif
elsksa
Licensed Customer
Licensed Customer
 
Posts: 784
Joined: Sat Jul 24, 2021 1:06 am

Re: Mix Texture and images with alpha channel

Postby elsksa » Thu May 18, 2023 4:10 pm

elsksa Thu May 18, 2023 4:10 pm
Andreas_Resch wrote:I haven't got any opacity stored in any of the color channels.

That was just in my particular case, typical with Megascans assets (and in game-dev/VFX workflows).
elsksa
Licensed Customer
Licensed Customer
 
Posts: 784
Joined: Sat Jul 24, 2021 1:06 am

Re: Mix Texture and images with alpha channel

Postby Andreas_Resch » Thu May 18, 2023 4:42 pm

Andreas_Resch Thu May 18, 2023 4:42 pm
Thanks. Could you please expand the mask layer of the circle so i can see the settings that you use in there. I tried Composite Texture but those settings are a bit overwhelming and I was not able to find a proper combination.
Andreas_Resch
 
Posts: 269
Joined: Sat Jul 28, 2018 6:29 am

Re: Mix Texture and images with alpha channel

Postby elsksa » Thu May 18, 2023 5:11 pm

elsksa Thu May 18, 2023 5:11 pm
Worth mentioning that there is also an invert option at texture-level (unchecked by default)
Image
Attachments
octane_k8EgC6pPbe.jpg
elsksa
Licensed Customer
Licensed Customer
 
Posts: 784
Joined: Sat Jul 24, 2021 1:06 am

Re: Mix Texture and images with alpha channel

Postby Andreas_Resch » Sat May 20, 2023 8:34 am

Andreas_Resch Sat May 20, 2023 8:34 am
I tried to recreate your node tree, but it doesn't work for me. As you can see my smileys are blended with the noise layer below. The opacity is merely calculated from the RGB info with the transparent parts being interpreted as black. From what I see in your node tree is, that you used an Alpha Image node as input into the mask layer. I need to use an RGB Image as I also want to use the opaque parts of the image.

Alpha_03.jpg
Andreas_Resch
 
Posts: 269
Joined: Sat Jul 28, 2018 6:29 am

Re: Mix Texture and images with alpha channel

Postby J.C » Sat May 20, 2023 10:52 am

J.C Sat May 20, 2023 10:52 am
If you have an image with alpha channel you need to use separate node for this image – Alpha Image. It's only used for extracting alpha channel. For other images use RGB or Grayscale image nodes.
compossite texture.jpg
CPU – i9 13900KF, 128GB RAM, GPU – RTX 4090
System – Windows 11
My Behance portfolio, Blender plugin FB support group
J.C
Licensed Customer
Licensed Customer
 
Posts: 1723
Joined: Thu May 13, 2010 6:35 pm
Location: Wrocław
Next

Return to Blender


Who is online

Users browsing this forum: No registered users and 41 guests

Sat Apr 27, 2024 8:13 am [ UTC ]