x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Alpha blending textures in material

I've got a texture with an alpha channel in ue4 and I would like to alpha blend that texture with a base color similar to how an alpha masked texture works in photoshop. I can't find any node in the material editor that does this. How can I achieve this?

Product Version: Not Selected
Tags:
more ▼

asked Apr 02 '14 at 04:21 PM in Using UE4

avatar image

HappyDay
40 7 8 12

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

The lerp node was the first thing I tried. It didn't give me the same result as photoshop and I spend hours trying to understand what's going on. It turns out the problem is the way photoshop exports alpha channels and has nothing to do with ue4. The lerp node is exactly the right node for alpha blending. I'll explain with the help of a few screenshots:

Here's my basic setup in photoshop. There's a red base color layer, a dirt layer with alpha channel generated with dDo with (normal blend mode) and an ambient occlusion map (multiply blend mode). This is a view of the dirt layer. I exported all layers individually and also saved a texture with all layers merged. Here's the same setup in ue4, currently connected to the merged texture. The goal is to get that same look but being able to adjust the base color in the material. When connecting the network blending the individual textures the result is very different. I'm still not quite sure why photoshop adds a white background and multiplies it with all translucent pixels when exporting the tga. I couldn't get this issue resolved in photoshop. Opening the psd in gimp and exporting the dirt layer as tga works fine though. So that's my workaround at the moment. Another related issue I encountered trying to reproduce the look of the texture in ue4 was the color profile used in photoshop. The default color profile seems to be a different one than used in gimp or ue4, which also took me a while to figure out and contributed to the colors not matching. Truth be told, I don't like photoshop in general or adobe's subscription policy and I'd rather be using gimp but dDo is just too powerful to not use it. UE4 and epic on the other hand are awsome. :)

So in short, yes you're right NaMJaG.

I hope my little explanation will be useful to someone else.

more ▼

answered Apr 04 '14 at 10:52 AM

avatar image

HappyDay
40 7 8 12

avatar image Cynderus Sep 24 '18 at 04:00 PM

Thank you for recommmend the LERP node, it helped me!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

I think you're searching for the lerp (linear interpolate) node. connect your texture color output to the second input of the lerp node and the alpha channel of your texture to the alpha input on the lerp node. Then connect your base color to the first input of the node.

I think that is what you where searching for, am I right?

more ▼

answered Apr 02 '14 at 05:57 PM

avatar image

NaMJaG
61 2 3 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

In Photoshop saving a tga with alpha is not only saving the Image. tga is able to keep the information in the 100% alpha areas of the image (not like png by default). So you have to add a alpha channel in photoshop and save it as an 32bit tga to have the right alpha information. If you don't want the white areas simply fill these areas with an average color or you add some layers with a blured version of the image below to have a proper background. This is very useful if you want to use the alpha channel of the diffuse or normal for a height map, ao, mask or something like that without losing color information in the other channels.

good luck and hf :)

more ▼

answered Apr 04 '14 at 11:47 AM

avatar image

NaMJaG
61 2 3 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question