Hiding an actor partially
Hello everyone! I was wondering if there was a way to stop an actor from rendering partially when for example it enters a volume. In my level i have a mesh for my water and ive made a ripple effect with a particle system for when i collide with it(still working on it) and i ran into a problem where if the character enters the water near the water meshes edges the particle effect kind of expands out of the area i want it to be in. So i was wondering if it was possible to sort of border out the water area with volumes surrounding it that would stop the particle effect from expanding out of the water. This wouldnt be a problem with normal water but mine happens to defy gravity a bit since it has no physical edges, its just a box. Thanks for any help!
asked May 06 '15 at 08:38 AM in Rendering
There is currently no CubeMask function but it is fairly straight forward to make. I will add this to a future UE4 release, probably 4.9:
Works slightly different from spheremask. You set the edge falloff in units rather than 0 to 1 hardness. Making it work with hardness would require some more math and not worth it IMO.
answered May 06 '15 at 10:00 PM
You can do this inside the material.
Make a material and give it some instance parameters representing the box edges. (This will be easiest if the box for your water is axis-aligned -- meaning that it's straight-edged along X and Y and not rotated at all. If you need it to work some other way, let me know).
The material would basically do this: get the world position. If the world position is between the upper and lower limits for your box, set the opacity as usual. Otherwise, either set it to zero (for a hard edge) or fade out (you can use a lerp to blend out as the world position approaches the boundary).
I don't know how much you know about materials so if you need more info, let me know.
answered May 06 '15 at 10:27 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here