Fading Object in UE4 Based on its Angle
Events
Subscribe:  iCal  |  Google Calendar
7, Mar — 12, Jun
16, Apr — 23, Apr
Breda NL   23, Apr — 26, Apr
24, Apr — 27, Apr
Vilnius LT   3, May — 5, May
Latest comments
by diegographics@outlook.com
16 hours ago

Wow, that's great. Have to try this out!

Wow beautiful environment. Very thorough and detailed. But I think there are a few images that are not showing up (error?). Is that just me? Interested in seeing those other pictures...

by Admin
2 days ago

Jack. First of all, I want to apologize for offending you. We published this just to show how the tech could be used. We don't actually care about the message. But you do bring up a viable point, that for some people - this might be an issue, so I take this post down.

Fading Object in UE4 Based on its Angle
8 September, 2017
News

Rodrigo Mizuno shared a quick guide for UE4 users. The tutorial focuses on faking light shafts, glow and stuff using planes. 

Here is a quick tip of one in many ways on how to create a mask based on the angle of your object in relation to your camera. This trick is particularly useful for when you are using cards to fake light shafts, glow and other things.

The idea is to first find the relationship  between the object, the world and the camera.  Transforming the vectors from world space in to local space is really important for it to work no mater where the object is (now that I look at it, I have the feeling the TransformVector node after the ObjectOrientation could be removed).

side

After it is just a mater of manipulating those vectors to achieve the desirable result.

The Aboslute Value node is transforming the gradient that goes from right side to the left side of the object in to a gradient that starts from the front and goes to both sides equally.

absolute_exemple_01

Example of how Abs is affecting your mesh, the sides of the square being the left and right angle of your mesh and the center being the front

If for some reason you want the sides masked but not the top, remove the CrossProduct node and add OneMinus instead.

That should give you the mask you want, now you can control how much to the sides and how strong you want the effect to be.

biasScale_exemple_01

Simple way to manipulate a gradient

If you only want your geo to fade from the top all you need to do is isolate the blue channel (Z) and use it as your mask.

objTopFade_shader_01

I think that is all, let me know if you have any question, suggestions or know some other way of doing the same trick.

fade001

Rodrigo Mizuno

Was this guide useful? Do you know another way to deal with this task? Share your thoughts in the comments below.

Comments

Leave a Reply

3 Comments on "Fading Object in UE4 Based on its Angle"

avatar
bramagola
Guest
bramagola

Or just use a Fresnel node?

Tom
Guest
Tom

Great! thx!

Coverop
Guest
Coverop

Thanks for sharing this trick! 8D

wpDiscuz