Hey guys, just a heads up.
For those of you who struggle to get a transparency on a mesh inside the water, you can copy your mesh (or make a super simplified version of it), turn off shadows casting for it, check “render custom depth” and uncheck “render in pass”. Just make sure to also turn off collision and physics for your transparency mesh.
Custom transparency for objects on surface tutorial
- Create a mesh, that covers the top of the object
- Place it on top of the mesh
- Setup your content inside UE4.
Here is a modified version of Construction Script of BP_BuoyantActor
Notice that I added additional transparency mesh. With way of setting up BP you can have your transparency mesh empty unless you need it. Make sure to make it public to easily acces it.
Here is a list of settings you need to change for your transparency mesh inside BP_BuoyantActor
Also notice that I don’t index for custom depth, but I do change stencil mask to 1 bit (works with other too, but gives better performance) That is because system uses the same post process material that is used in pp volume array.
- Place your BP into scene (or copy existing one and modify it’s properties the way you need it to be)
should give you transparency as long as you not trying to submerge your camera into the water surface. The moment you do it - illusion breaks apart. Sometimes clipping still happens, but you can fix it if you make sure your mesh follows waves precisely.
Big shout-out to Obscura on polycount forum for posting a solution for the exact same problem http://polycount.com/discussion/1946…h-custom-depth
If you are going to make a submarine, you still need to follow https://wiki.unrealengine.com/Locati…n_UE4_Playlist tutorial and implement your own mask into material, which is unfortunately limits amount of vehicles you can have in your scene and gives a headache if you need a custom shape for your vehicle, because not only you gonna need to mathematically explain it to the engine, you also gonna need to find a way to rotate it on surface.
I also recommend you to check out thread, it has a whole bunch of possible solutions to problem.
https://.unrealengine.com/deve…–possible
Hope it helps.