[SOLVED] Clouds ignored at low visibility


photo

Recommended Posts

Hey everyone,

in Unigine 2.9 the clouds seem to be removed, when the max visibility range for the haze/fog effect gets relatively low (due to the camera far plane decreasing as well?).

Because of that, the sun appears more bright at low visibility, even though the cloud density might be set to the maximum. It essentially ignores the cloud settings entirely at low visibility.

Even when setting the texture intensity of the sun to 0, a spot bright spot in the sky remains at where the sun should be.

I tried to look into the environment.frag shader and played with the mie LUTs (though I do not understand how exactly it works) in the environment presets, but nothing lead a proper solution.

I am pretty sure it is related to the mie scattering in some way though.

 

Below I took some screenshots to illustrate the issue. All screenshots were taken from the same camera position and the sun texture intensity of all environments was set to 0.

Note that screenshot 2 and 3 look exactly the same, as the clouds seem to have disappeared. If it was working correctly, screenshot 2 should look like screenshot 1.

HighCloudinessHighVisibility.thumb.png.37460aaf848102bc9791a84f9a84873d.png

HighCloudinessLowVisibility.thumb.png.7aab88ee2b8fed7a849e32e96356836f.png

LowCloudinessLowVisibility.thumb.png.2e1b1bb76f8b63a46c42cc8c1c25d1d3.png

Does anyone have an idea on how to fix this? Please let me know if more information is required to solve this.

Thanks a lot in advance!

Link to post

Hello,

Both far plane clipping and haze distance parameters were made for optimizations. In your case clouds are simply being culled and they no longer affect light scattering.

To fix this you'll need to do the following:

  • Set Haze Distance equal to the Camera far clipping plane distance
  • Then change Haze density in the environment preset parameters to imitate low visibility.

This approach will leave clouds and other objects in the background and the sun still will be occluded by them. Additionally, you can modify sun intensity.

We're going to address usability of these parameters in 2.12 (already experimented with it) and make them easier to understand

Thank you.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post

Thank you very much for the info, I just tried it and it works like a charm!

  • Like 1
Link to post
  • morbid changed the title to [SOLVED] Clouds ignored at low visibility
  • 4 weeks later...

Hey again,

 

by now I have tried a few things with your suggestion and noticed some issue with them. So I wanted to ask for help again!

As you can see in the picture below, when leaving the fog distance at the maximum and only modifying the fog density, the clouds still contribute to the light scattering as you said.

However the objects, such as the ship in the scene, become heavily occupied by the fog which makes it look very strange from a close perspective.

Is there perhaps a way to address this problem too?

Or are there by any chance plans to make the fog work as normal and have the clouds contribute to the light scattering even at low visibility in one of the future engine updates?

 

FogForumPost.thumb.png.4b8f5786da4bb9da201a79886ed329eb.png

 

Thank you very much for your help!

Link to post

Hello,

Could you please elaborate on the screenshots comments? What do you mean by variable fog distance. Do you change it dynamically in runtime?

And how should it look like? Second image shows us the desired result?

The "normal fog" is not that easy since we develop SDK :) Current version provides 4 parameters to imitate different visibility conditions:

  1. Camera visibility distance
  2. Haze distance
  3. Haze density
  4. Environment preset intensity

Honestly, I don't understand where's the issue. Do you want it to act differently on a closer range?

18 hours ago, DonMazzini said:

Or are there by any chance plans to make the fog work as normal and have the clouds contribute to the light scattering even at low visibility in one of the future engine updates?

Our render team researches possible improvements for haze, fog and clouds. I can't say when it will be production ready.

Thanks.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post

Hey,

sorry for the confusion and my wording sometimes, let me try to better explain what the problem is.

The second screenshot shows how the fog looked like initially, before I played around with your suggestions from this thread. There we changed the haze distance, haze density and environment preset intensity at runtime depending on our given weather condition sliders. I believe that the camera visibility distance was not directly modified, as it seemed to be applied when setting the haze distance (maybe that's not how it works?). Generally speaking, the fog in this image looks very good, but the lack of the cloud scattering at low visibility (<1-2km) is what makes it a bit imprecise to use in our case.

The first screenshot shows a fog approach based on your suggestions in this thread, so that the cloud light scattering should be preserved at all times. In this approach only the haze density and the environment preset intensity were changed during runtime while the haze distance was always set to the maximum camera distance. Once again, the camera visibility distance itself was untouched. While this helped with the cloud light scattering, it either made the fog appear too strong on custom objects. And this is where the problem is: our player camera will basically be on the ship most of the time, so it would be strange to see an entirely fog colored ship when the visibility is fairly low.

It is very much possible that there is currently no solution to this in Unigine 2.9, but I thought maybe I am lucky and you're able to help :D

Thanks a lot for taking your time and answering my questions! Please let me know if you need more information from my side.

Link to post
36 minutes ago, DonMazzini said:

I believe that the camera visibility distance was not directly modified, as it seemed to be applied when setting the haze distance (maybe that's not how it works?).

Camera far clipping and haze distance are two independent parameters. But it's better to keep them synchronized to avoid unexpected effects.

40 minutes ago, DonMazzini said:

And this is where the problem is: our player camera will basically be on the ship most of the time, so it would be strange to see an entirely fog colored ship when the visibility is fairly low.

So with the settings you're using even when the camera is on the ship it is still partially hidden with the fog? I'd expect that the ship model will be clearly visible with the camera on the board or in the deckhouse. Can you attach an image that shows view from the ship?

I also got an update from the team, and we will include modified haze in 2.12. Right now I'd like to understand your issue better :)

Thanks.

  • Like 1

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to post
1 hour ago, morbid said:

Camera far clipping and haze distance are two independent parameters. But it's better to keep them synchronized to avoid unexpected effects.

I see! I believe at some point I tried to set the camera far plane to something else after setting the haze distance, but the camera far plane did not seem to be applied. But if you say it's better to keep them synchronized to avoid artifacts anyway, it should not matter for me.

1 hour ago, morbid said:

So with the settings you're using even when the camera is on the ship it is still partially hidden with the fog? I'd expect that the ship model will be clearly visible with the camera on the board or in the deckhouse. Can you attach an image that shows view from the ship?

Below I included some pictures to show that. The first picture once again shows the original implementation with the light scattering issue where the ship cannon looks as it should (only a small amount of fog is applied). The second picture shows the same angle, just with the implementation that used a constant camera far plane and only modified the density at runtime. Furthermore, this can be observed for pretty much all solid objects in the scene.

OldFogOnShip.thumb.png.e41918970022af83b5bbb1a4d08e32de.pngNewFogOnShip.thumb.png.109920a7dc738c13778e9f65a132db20.png

1 hour ago, morbid said:

I also got an update from the team, and we will include modified haze in 2.12. 

That's great to hear, thank you very much!

  • Like 1
Link to post

Unfortunately, we have been using the short range fog already. But I will try to create a scene with these settings so you can check if there is something wrong with it! 

Link to post

Hello,

Which values are you using for your setup? Camera distance, haze density etc.

w.

Edited by werner.poetzelberger
  • Like 1
Link to post

Hey,

the haze settings in the setup with the heavy fog were:

Camera distance: 50000

Haze distance: 50000

Haze density: ~600 (set by code)

Environment intensity: 1

Haze scattering mode: Short range

 

In our application, the maximum camera distance is 50000 (meters), so in order to have the cloud light scattering present at all times both the camera and the haze distance is kept at the camera maximum. To account for that and still achieve a similar effect, the haze density was severely increased. When turning it down further (I tried like 110), the ship is a little less affected by the fog, but the rest of the environment also received way less fog on their surfaces. Another issue we are facing in that regard is, that our application has a visibility distance setting which should hide all objects that are further away than this distance behind the fog. In this case, it was set to 1000 (meters). While this worked very well with the initial approach of changing both the density and the haze distance at runtime, it seems difficult to achieve this with this approach.

 

Thank you very much for your help! Let me know if you need more information.

Edited by DonMazzini
Link to post

I experience better results with Long Distance Range and a Low Density. The distribution seems to be more plausible.

600 density seems to be pretty extreme. In our experience, setting values out very extreme, might cause issues somewhere else.

Probably Volumes help you as well.

You can create local areas for fog or clouds, instead of working completely 'globally'.

https://developer.unigine.com/en/docs/2.11/objects/effects/volumetrics/volume_box?words=volumes%2Cvolum#highlight

The clouds have a Shading Value called Haze Gradient. Might that help you?

Best.

w.

 

 

 

Edited by werner.poetzelberger
  • Like 1
Link to post

Using a long distance range and a low density unfortunately does not seem to hide objects behind the fog reliably, so I'd need another way to do that.

I will give the Volumes a try, maybe it could help!

The haze gradient value for the clouds already seems to be configured well enough, I have already played around with it in the past.

 

Thanks!

Link to post

Hey,

unfortunately I was unable to recreate this scene without scripting due to the restriction of the haze density.

But the rough dimensions of the ship were: 23 width, 32 height, 97 length.

 

Good luck and thank you!

Link to post
  • 4 months later...