Announcement

Collapse
No announcement yet.

Is this possible

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    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 issue 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

    I doubt this is possible but it doesn't hurt to ask

    Leave a comment:


  • replied
    Thanks Arnage,

    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 effects in UE4 are requiring that you have the scalability settings set to high or epic

    Leave a comment:


  • replied
    You can selectively toggle whether a material should use separate translucency. (It's on by default)

    In this 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 this 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.

    Leave a comment:


  • replied
    Arnage,

    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

    With separate translucency:

    Click image for larger version

Name:	2.jpg
Views:	1
Size:	177.1 KB
ID:	1075068

    Without separate translucency:

    Click image for larger version

Name:	1.jpg
Views:	1
Size:	164.5 KB
ID:	1075069

    Thanks

    Leave a comment:


  • replied
    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

    Leave a comment:


  • replied
    That worked perfectly, thank you so much

    Leave a comment:


  • replied
    You have to manually apply the separate translucency in the post process, for example like this:

    Click image for larger version

Name:	PostProcessSeparateTranslucency.jpg
Views:	1
Size:	179.0 KB
ID:	1075033

    Leave a comment:


  • replied
    Arnage,

    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

    Thanks

    Leave a comment:


  • replied
    Originally posted by KhenaB View Post
    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 this to something less linear should improve it.

    I guess the main take away in all this is: real life is almost never linear

    Leave a comment:


  • replied
    Also the exponential falloff made an amazing difference

    Leave a comment:


  • replied
    Thank you for the explanation

    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, this is not real life accuracy but it looks right for my scene

    Click image for larger version

Name:	turbidity.jpg
Views:	1
Size:	177.0 KB
ID:	1072169

    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

    Click image for larger version

Name:	Bottom.jpg
Views:	1
Size:	123.6 KB
ID:	1072170
    Last edited by KhenaB; 04-09-2015, 02:51 AM.

    Leave a comment:


  • replied
    Btw. the easiest way (at least for me) to better understand the math of a shader is to not only look at the effects in the viewport. It's math, so just throw it at a graphic calculator or wolfram alpha and it becomes a lot easier to understand what is happening.

    As an example, here's a plot of that linear falloff compared to an exponential one:



    This directly shows why a linear falloff causes a harsher transition.

    Leave a comment:


  • replied
    That works, the only thing I would recommend is using an exponential falloff instead of a linear one. I adjusted it to this:

    Click image for larger version

Name:	DistanceBlending.png
Views:	1
Size:	150.5 KB
ID:	1072166

    Note that I also inverted both the top/bottom and distance effects. As this allowed me to replace the lerps with multiplications. Not really necessary, but it works a little more intuitive.

    Edit: We seem to have posted at the same time. That too steep falloff you mention is probably caused by the linear falloff I mentioned here so I may have answered your question before reading it :P
    Last edited by Arnage; 04-08-2015, 04:53 PM.

    Leave a comment:


  • replied
    Here are some of my results with the above distance factor added, the falloff curve seems to be a little to steep but this is something i still don't fully understand mathematically yet

    Click image for larger version

Name:	1.jpg
Views:	1
Size:	303.7 KB
ID:	1072160

    Click image for larger version

Name:	2.jpg
Views:	1
Size:	312.1 KB
ID:	1072161

    Click image for larger version

Name:	3.jpg
Views:	1
Size:	326.7 KB
ID:	1072162

    Leave a comment:


  • replied
    This seems to work, might not be the right way to do it

    Click image for larger version

Name:	Distance.jpg
Views:	1
Size:	351.3 KB
ID:	1072153

    Leave a comment:

Working...
X