Camera position based opacity mask
I am trying to create a material function which would create a cylindrical opacity mask that would affect the objects between the player and camera. For the opacity mask, I have used the distance field function for a cylinder "vec2 d = abs(vec2(length(p.xz),p.y)) - h; return min(max(d.x,d.y),0.0) + length(max(d,0.0));" and centered it on the player location. However, my attempts at rotating it so the bottom of the cylinder stays attached to the player, while the top faces the camera, have been rather unsuccessful.
In my setup, I am trying to rotate the vector using RotateVector material function, prior to passing it to the distance field function.
Couple notes- camera boom has fixed length and is not always attached to the player(sometimes it points few meters ahead, based on the camera pitch), it also inherits player yaw. Camera pitch has 30 degree constraint.
Our community manager for the Engine Development Forums, Chance Ivey, made a simple material along with using Blueprints to drive the effect you're looking to do.
He's posted a short video, the blueprint layout, and the blueprint assets for you download as well. It may need some tweaking to get just the way you like, but it should be a good start.
The second link was made by our Senior Technical Artist, Alan Willard, who made it into a two part video series.
Location Based Opacity
Hopefully this is what you are looking for, and let me know if you have further questions or need additional help!
answered Jul 21 '15 at 08:15 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here