I’m attempting to implement pool water in a first-person game using Unreal Engine 5.1. I grew frustrated with Unreal’s default implementation of water (entirely height-based post-processing effects, requiring terrain to function properly, and extraordinarily broken custom water bodies) and after some struggles I managed to implement something that works for the most part—allowing swimming and buoyancy in a user-defined volume that can be used without generating any kind of terrain; very useful for indoor pools or pools of water with tunnels underneath. I even found a tutorial that let me develop a water line.
The problem is that for this water line to work I have to manually define a “water height” parameter. If I move the body of water afterwards all post-processing effects disappear. I’d much rather just be able to place this water body into a scene and move it around as I need.
My question is, then, what’s the best way to smoothly transition into and out of a post-processing volume, I.E. if a player jumps into a pool, how do I make it look like the camera is half-submerged? Is a static parameter defining water height required, or is there a better way to control this value?
I’ve tried looking this up online, but all I’ve gotten are basic tutorials on post-processing volumes, or videos on the default water system, neither of which are useful.
I somewhat understand the logic behind it, and I think my initial implementation was a variation on one of the previous videos in this series, but I can’t get it to work.
Is it really only possible to smoothly transition into a post-processing volume by creating an entirely separate scene capture component like that?
Anyone searching this up, I have managed to create a solution thanks to this post:
This isn’t a very pretty solution, it’s basically just adjusting the already existing water height parameter to correspond to the height of the actor. It does so by converting the material to a dynamic instance at the start of play, then simply changing the parameter.
This works well for calmer bodies of water. A solution for the choppier waters produced by waves would likely require some finagling. Luckily, my focus was on indoor bodies of water, which wouldn’t be so choppy.