Hey guys, I just wrote a quick guide about how to fade a object base on
its angle, using Ue4, its useful for faking light shafts, glow
and stuff using planes without making so obvious that its just a plane.
![](https://us.v-cdn.net/5021068/uploads/editor/cz/mo3lyiv4a7s9.gif)
![Image: https://us.v-cdn.net/5021068/uploads/editor/jz/75mqi3xz43hf.gif](https://us.v-cdn.net/5021068/uploads/editor/jz/75mqi3xz43hf.gif)
You can find the more details and a bit of explanation on the workflow on my website:
https://rohmizuno.com/object-angle-fade/If you want the fading to occur on the sides+top:
![Image: https://us.v-cdn.net/5021068/uploads/editor/89/8jltznt8cjj0.jpg](https://us.v-cdn.net/5021068/uploads/editor/89/8jltznt8cjj0.jpg)
Just the to top of the object (scroll down for a alternative and lighter solution):
![Image: https://us.v-cdn.net/5021068/uploads/editor/tt/9fxyrcq91q4h.jpg](https://us.v-cdn.net/5021068/uploads/editor/tt/9fxyrcq91q4h.jpg)
If you know a cheaper or alternative way to achieve the same result feel free to let me know here, or if you have any questions.
Replies
Seems like it does very broadly the same thing
0,0,-1 in camera space means pointing towards the camera and the ObjectOrientation points to the object's z+ axis. If you get the dot product of both, you'll get 1 if the object's z+ is pointing towards the camera, 0 if it's perpendicular and -1 if it's pointing away.
Abs turns the negative values positive, and Saturate clamps them between 0-1 so you can use either depending on what you want
and thank for sharing that information @Bruno Afonseca I did not know you could use a 3vector like that (makes a lot of sense now that I think about it). It works great from fading the object from the top and it saves about 5 instructions
How would you do about making it work on the front of the object?
And yes, @marks solution would produce a fresnel (inverted), it also won't work for camera oriented sprites (their normal always aligned to the camera).
Shortest version of what your second example was in the first post:
"if you use dot product with exposed vector 3 parameter, you can then specify which axis to use in material instance per case:
"
I also updated my blog post with most of the information that you guys provided here, so thanks a lot for sharing and helping!
high angles, making it less obvious that the trees were so low poly.