Lake water reflection does not respect Heightfield Resolution

Started by Nala1977, May 15, 2020, 04:25:44 PM

Previous topic - Next topic

Nala1977

So i am having a huge issue here which is a showstopper for me.
i've set a lake with a water shader with wave scale 0 and roughness .01.
The mountain in the image is an heightfield map from gaea, in the reflection on the lake you can clearly see that the mountain is not subdivided and doesnt have the details.

Anyone knows any workaround? is it a bug?

the second image is just plugging a reflective shader instead of the water shader. i wanted to create a mirror like lake, but it looks like the reflections dont take into account the heightfield map.

WAS


Nala1977

Quote from: WAS on May 15, 2020, 04:51:10 PMTry upping your RPD and use a 360 Degree Crop Region.

Ray detail region:
https://www.planetside.co.uk/wiki/index.php?title=Render_Node_(TG3)#Advanced_Tab

Ray detail multiplier:
https://planetside.co.uk/wiki/index.php?title=Render_Subdiv_Settings

thanks, i tried with 360 optimal and i still didnt have enough details, had to use 360 highest.

WAS

Quote from: Nala1977 on May 15, 2020, 04:59:28 PM
Quote from: WAS on May 15, 2020, 04:51:10 PMTry upping your RPD and use a 360 Degree Crop Region.

Ray detail region:
https://www.planetside.co.uk/wiki/index.php?title=Render_Node_(TG3)#Advanced_Tab

Ray detail multiplier:
https://planetside.co.uk/wiki/index.php?title=Render_Subdiv_Settings

thanks, i tried with 360 optimal and i still didnt have enough details, had to use 360 highest.

You may be able to use otpimal with 1 RDM.

Tangled-Universe

In this case you're primarily/in the first place suffering from lack of information of what to reflect outside of the crop render 'frustum' and thus you only need to add ray detail region padding...
Since you're rendering a crop you need to use "Detail in crop region" mode and set it to 0.5 for starters.
The value you enter there is a multiplier for the area of your crop with which you will extend the area to sample information to be used in your crop.
Since your crop is very large you don't need very high values. 0.5 will exceed the boundaries of your camera frustum.
The 360 modes are more expensive to render and you would need those in cases where elements behind the camera also affect what's happening in front of the camera, which is not the case here.

After that's fixed you will end up with a reflection which does not have the same detail as the terrain being reflected.
At this point the ray detail region multiplier becomes important in some use cases and this is one of those cases since your lake is a perfect mirror.
Default ray detail multiplier is at 0.25 which means that the micropoly detail setting of your render will be multiplied with this value for reflected/refracted surfaces.
Default micropoly detail = 0.5...so the reflected terrain detail will be similar to rendering your terrain with micropoly detail at 0.5 x 0.25 = 0.125.
So for perfectly mirrored terrains in your lake you would like to set the ray detail multiplier to 1. Now you will render your reflected terrain at the same quality as your terrain.
With disturbed/wavy water there's usually less need/desire for these very high quality reflections or refractions and rendering those at lower quality is a lot faster without much loss of visual fidelity. Except in this case.

Below is a chart which shows that for this situation ray detail region is the first problem to fix, since a high ray detail multiplier (example 2) does not make any difference by itself.

For your situation these settings should be sufficient:
Detail in crop region mode with a padding setting of 0.5
Ray detail mulitplier at 1.

This should work, since I used more conservative padding in my example than I just suggested for you, since my crop region is only half the height of the image.

Nala1977

thanks guys, i've managed to fix it, didnt know about that advanced settings where you could set the ray detail multiplier higher!

WAS

Quote from: Tangled-Universe on May 16, 2020, 06:43:56 AMIn this case you're primarily/in the first place suffering from lack of information of what to reflect outside of the crop render 'frustum' and thus you only need to add ray detail region padding...
Since you're rendering a crop you need to use "Detail in crop region" mode and set it to 0.5 for starters.
The value you enter there is a multiplier for the area of your crop with which you will extend the area to sample information to be used in your crop.
Since your crop is very large you don't need very high values. 0.5 will exceed the boundaries of your camera frustum.
The 360 modes are more expensive to render and you would need those in cases where elements behind the camera also affect what's happening in front of the camera, which is not the case here.

After that's fixed you will end up with a reflection which does not have the same detail as the terrain being reflected.
At this point the ray detail region multiplier becomes important in some use cases and this is one of those cases since your lake is a perfect mirror.
Default ray detail multiplier is at 0.25 which means that the micropoly detail setting of your render will be multiplied with this value for reflected/refracted surfaces.
Default micropoly detail = 0.5...so the reflected terrain detail will be similar to rendering your terrain with micropoly detail at 0.5 x 0.25 = 0.125.
So for perfectly mirrored terrains in your lake you would like to set the ray detail multiplier to 1. Now you will render your reflected terrain at the same quality as your terrain.
With disturbed/wavy water there's usually less need/desire for these very high quality reflections or refractions and rendering those at lower quality is a lot faster without much loss of visual fidelity. Except in this case.

Below is a chart which shows that for this situation ray detail region is the first problem to fix, since a high ray detail multiplier (example 2) does not make any difference by itself.

For your situation these settings should be sufficient:
Detail in crop region mode with a padding setting of 0.5
Ray detail mulitplier at 1.

This should work, since I used more conservative padding in my example than I just suggested for you, since my crop region is only half the height of the image.

One could easily sum this up as; if your ray detail region is producing large polygons, RDM effect won't be noticeable on them, as there isn't much to effect. Last two shots significant effect when detail is present to work with.

Tangled-Universe

That's a confusing summary, frankly.

The reason I made some effort to explain which setting you need, why you need it and when you need it is that it allows one to understand what's going on.
Your suggestions were also not entirely accurate or correct. It's not always neccessary to go for the highest value of a certain setting or the most expensive padding mode for ray detail region.
It's important to understand how and why.
Another reason I made it, is that it's also easier to refer to from now on, since this question returns every now and then.

Cheers

Matt

Lots of good information there, @Tangled-Universe. I would just like to say that "Detail in camera" is also a reasonable choice when doing crops. This way you know that the crop will render the same as the full image, and you don't need to use high padding values just to get the crop to render correctly when those padding values could be lower for the full image. I sometimes wonder if the default should be "Detail in camera", but I chose crop because it's faster.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Quote from: Tangled-Universe on May 16, 2020, 04:10:05 PMThat's a confusing summary, frankly.

The reason I made some effort to explain which setting you need, why you need it and when you need it is that it allows one to understand what's going on.
Your suggestions were also not entirely accurate or correct. It's not always neccessary to go for the highest value of a certain setting or the most expensive padding mode for ray detail region.
It's important to understand how and why.
Another reason I made it, is that it's also easier to refer to from now on, since this question returns every now and then.

Cheers

Well, I already linked the wikis, which explain their functionality. You also ended your post with the suggestions I advised by obvious detail restrictions of various settings (rdm difference in final frames is too big a gap and easily noticeable). I wasn't explicitly telling him what to use, but what to try for his scenes. Detail in crop region may not work in his scene as he moves forward, as well if elements too far off camera end up in reflections with different camera angles, but for crops, and crop blending, it's a good method.

Maybe you should spend your efforts on the wiki instead of the forums, where it's likely not to help as much (down the road).

And how is it a confusing summary? If there is no data to multiply, how can it effect it? Look at your own reference image. There is no difference when it's a basic polygonal mesh, but when the data is there, it can multiply it.

Tangled-Universe

Quote from: Matt on May 16, 2020, 04:54:09 PMLots of good information there, @Tangled-Universe. I would just like to say that "Detail in camera" is also a reasonable choice when doing crops. This way you know that the crop will render the same as the full image, and you don't need to use high padding values just to get the crop to render correctly when those padding values could be lower for the full image. I sometimes wonder if the default should be "Detail in camera", but I chose crop because it's faster.

Ah right, I see. I thought 'Detail in camera' was for uncropped full renders where you would still want to add a bit of padding for stuff outside the frustum, but still in front of the camera.
Though I haven't ran into this issue for several years anymore, I guess you made some improvement on that, not sure.

Thanks!

N-drju

Martin, one could easily compile all of your tips and know-how into a book. :D The amount of knowledge you have is really impressive. I just wish there was a way to bookmark posts to return to these tips when faced with one CG-challenge or another.
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

Dune

Just copy any interesting text and make your own book.