I have increased the Distance Factor of the Turbidity Diffusion, my ocean is really deep and it turned dark too quickly, it now matches the depth of my ocean pretty well, is not real life accuracy but it looks right for my scene
However increasing the Distance Factor caused the effect to be scaled out of proportions, when looking down, the diffusion radius is too small for its distance now, it appears very narrow
That is probably related to the linear relationship between intensity and the Z axis in the top/bottom effect. Changing to something less linear should improve it.
I guess the main take away in all is: real life is almost never linear
A quick question regarding the light absorption effect
To get good results i have to set the effect to “before tonemapping”, setting it to “before transparency” isn’t properly blending with the translucent objects in my scene, but i want my helmet glass reflections to be drawn over everything in my scene
Is it possible to draw the reflections of my helmet glass over the post process effect while keeping the post process material set to “before tonemapping”? Even with a high priority sorting the post process is always drawn above translucency
I was thinking about adding even more details to the scene, and crepuscular or god rays would be an amazing addition, and since you have already implemented light absorption, wouldn’t it be possible to use that to make some low cost god rays?
I don’t fully understand how water and light interact with each other, but i assume that god rays are there because of the wavy water surface, making light penetrate unevenly?
I’ll try to find some papers on that subject and see if i can come up with something
Concerning adding the separate translucency manually, i have noticed that it gives me the same results as setting the material to “before translucency”
It makes my translucent helmet glass render over the PP effect but all the other objects in my scene too, some of them needs to be rendered below the PP effect
Could it be that i missed something?
For example, with your trick my helmet is now fine, but the diving water surface isn’t affected by the fog anymore
You can selectively toggle whether a material should use separate translucency. (It’s on by default)
In case you should be able to toggle it off for the water surface, as well as any other material that should be affected by the post process material, to get the result you want.
Btw. you are right that blend seems to have the same effect as using “before translucency”. Using that is probably more efficient than doing the blending in the post process material. (Selectively toggling separate translucency on and off also has the same effect in both cases)
Regarding god rays: these are indeed caused by the waves. I believe you already had caustic patterns in your lighting. Underwater god rays are basically the interaction between these caustic patterns and particles in the water. The absorption effect I posted assumes a uniform light distribution as it’s is much cheaper. However, there are many ways to fake god rays in a cheap manner. The current build-in effect is a cheap and effective approximation as long as you are looking at the light source. More correct ones that are also visible when looking away from the light would be a little more complex.
Looking at the kite demo you can actually see them in the final scene in the cave with all the kites, which seems to indicate that Epic may have implemented a system for those in 4.8. So you could wait for the 4.8 preview to be released to see how they pulled it off or implement your own system right now.
I did not know about the separate translucency, my water plane now blends with the effect
About the kite demo, interesting, you have a sharp sense of observation, the effect is quite subtle but it looks good, at first i thought it was the already implemented sun shafts from the directional light but remembered that those are dependent on the camera orientation? I wonder how performance heavy they are, some of the in UE4 are requiring that you have the scalability settings set to high or epic
Do you think it would be possible to mask the absorption effect, right now i rely on lerps to fade the effect when i get to the ship interior, the main is being able to see both the underwater and the ship’s interior when inside the suit and standing half way underwater, the only thing i have been able to do was to lerp the turbidity distance depending on my height, and make the distance far enough so it wouldn’t affect the ship’s interior but still hide my underwater terrain
EDIT, doh, I accidentally replied when looking at page1 of thread. Somehow I missed all the other posts talking about problem. The below approach would be for a case where the water was a real plane being masked by a box mask in the world. It would build the lip into the water material rather than on another window mesh.
It is possible but kinda tricky since you need to “project” your plane mask forward by solving the right triangle defined by your view vector and desired water lip height.
To solve the triangle remember that a^2 + b^2 = c^2 where c is hypotenuse. Can get hypotenuse length for a unit vector side by doing (cameravector,PlaneNormal). Then you get the slope by doing a/b (aka rise/run).
Then the forward extention amount is simply lipheight * (1/Slope).
So you keep your current mask as the Lerp alpha between top and side water. Then you use the larger projected mask to cut out beyond the water lip.
To define the normals of the lip you could Lerp between two vectors, an upvector and the normal of the inside of your glass pane, using the distance between the original mask and extended mask.
will only work for when the view is above the water looking down. Solving the other case is also possible but requires a bit more work that isn’t coming off the top of my head.
Not exactly, the method in post #71 is similar to what i use right now, when in the suit with head above the water surface i can see the underwater part without the effect, when under i can see the ship’s interior with the effect, is happening because i can see both underwater and above water when floating at the surface
I wanted to know if it would be possible to have the effect rendered at all time (or at least slightly above the surface to cover my helmet) but mask the effect from being rendered inside my ship, so that when floating at the surface i can see both the underwater part and the ship interior like they should be
@RyanB, i’m going to have to re-read that a couple of times, i have used masks in the past to mask out materials from being rendered in specific shapes and locations and was wondering if a similar approach could work, i’m not very good with maths so it might take me a while to understand what you’re trying to explain
The main reason why i’m trying to find a better solution to how i did it is that i had to switch to a tiled underwater terrain with world composition, initially my water surface was sitting at Z 0.0, world composition doesn’t allow me to lower my terrain so i had to re-do my entire coding and raise my entire scene to match the new height, the whole absorption post process had to be re-adjusted to really high values since my surface is now around Z 55,000, being able to mask the effect would look much better too
RyanB covers it above, but here’s a quick example of how to do it with one volume. Assuming a water plane at z=0, projects a plane, perpendicular to the camera view, 10 world units ahead. Then it checks if the intersection of each view ray and plane has a z value less than 0. If it is, the post process is applied, if not, it returns scene texture. If your water plane material has some z world offset then check the intersection z value against that.
Great Blueprint! Thank you for sharing! Can you explain the last part “If your water plane material has some z world offset then check the intersection z value against that”. I was able to follow your BP but when I added an ocean world displacement the PP_splitplane material is not following the water displacement as you mentioned.