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"

Blend Opacity?

Hey all, I'm wondering if its possible to adjust the opacity of a texture when you blend it with another one?

For example, I have a rock model with a base texture and a detail texture. I want to fade the detail texture over the base so I've used a Blend_Overlay node however this is blending the two textures at 100% opacity. I was wondering if there's a way to lower the opacity on one of the textures so its not so strong?

The reason I want to do this inside UE4 instead of photoshop is that the tiling on the detail texture is a lot smaller than that of the base texture.


Product Version: Not Selected
more ▼

asked Jul 26 '14 at 09:32 PM in Rendering

avatar image

1.2k 86 116 146

avatar image Skullwing Jul 27 '14 at 05:58 PM

If I understand you right, then you could use a Linear Interpolation (Lerp).

Put the first texture in the A input, the second one in the B input and Alpha has to be between 0 and 1 and is the strengh between the textures.

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

1 answer: sort voted first

Here you go! The overlay blending mode is "neutral" at 0.5 (grey). So I used a linear interpolation to blend between the texture and 0.5 using a scalar parameter, this so you can easily tweak it inside material instances.

Good luck!

alt text

example.jpg (450.8 kB)
more ▼

answered Jul 27 '14 at 06:28 PM

avatar image

2.4k 70 43 142

avatar image TorQueMoD Jul 27 '14 at 06:53 PM

You know, I tried to use place a LERP node but couldn't find it in the list anymore. The only ones that came up were the LERP scratchgrime nodes. I thought maybe it was removed and replaced with something else.

Thank you.

avatar image Roel Jul 27 '14 at 09:29 PM

Lerp is short for "Linear Interpolate", you can also place it by holding the "L" key and clicking with the left mouse button.

avatar image TorQueMoD Jul 28 '14 at 03:12 AM

I tried holding L and left clicking and nothing happened. Which is why I thought they removed the functionality. Very strange, I'll try again tonight.

avatar image Roel Jul 28 '14 at 01:34 PM

Try first clicking in the work space, hold L and then click again with the left mouse button.

avatar image Skullwing Jul 27 '14 at 07:45 PM

Totally not what I told him to do, haha...anyway, I guess you want to use this for a more detailed surface if you are close to an object? If so, you could do this easily inside the material, without scalar parameters...

avatar image Roel Jul 27 '14 at 09:31 PM

I know, I'm just a big fan of using parameters when someone is not sure what the end value is going to be. This way you make the material flexible and reusable. The other benefit is that you can change it dynamically, so you don't have to recompile the shader every time.

avatar image Skullwing Jul 27 '14 at 11:35 PM

Right, but it is more expensive than a simpler material, isn't it?

avatar image Roel Jul 28 '14 at 01:31 PM

This material is already more expensive because of the overlay. An overlay uses a branch so it's better not to use it.

This is the code for overlay: return lerp((Base*Blend*2),(1.0-(2.0*(1.0-Base)*(1.0-Blend))),step(0.5,Base));

The "step" is: return x >= a;

x being the Base.

The "lerp" is: return A+Alpha*(B-A);

So the shader is not cheap for just showing a texture. However, the scalar parameters should not have any real impact on performance, because if you are using a constant instead of a scalar you are still running the same code per pixel, just with an adjustable value. Changes of the compiler being able to optimize the constant in some way is close to 0, and even if that happens, the difference won't be noticeable.

avatar image Skullwing Jul 28 '14 at 03:18 PM

ok, thx for the answer!

(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