Jump to content

Field Mask for Haze


photo

Recommended Posts

Is there a Field Mask equivalent for Environmental Haze?

We are trying to stop the haze from rendering inside tunnel areas. 

Thanks.

Link to comment

Hi David,

There is no such setting available, I'm afraid. You can control this behavior manually via code. For example, use some shapes or triggers to mark tunnel area and then change Haze parameters to make it render further from the camera.

Thanks!

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

Link to comment
  • 2 weeks later...

I wonder if a field haze similar to the one for clouds (field weather) is something that could be be considered to add to the development roadmap (obviously I'm unsure of how difficult this would be under the hood).

The workflow of creating the trigger shapes vs spacer shapes would be pretty much the same as we would need them the entire length of a tunnel (as you can start inside a tunnel)

The issue we have had in the past with changing the parameters is usually on the entry and exit to the tunnels,

On entry you want to see fog in the distance next to the tunnel, but not inside it, and ramping the haze parameters means you always get some awkwardness between trying to not see the fog inside the tunnel but still seeing the fog outside the tunnel.

On exit, you want to see the fog outside the tunnel as you come towards the exit, but not inside the tunnel for too much.
This one is a bit easier to manage as the area of interest is much smaller but still a bit challenging.

The ramping is also ideally spatial rather than temporal to make it more like the effect of the field weather attenuation, which is also a bit more tricky to handle.

 

Link to comment

Hi Chris,

Quote

I wonder if a field haze similar to the one for clouds (field weather) is something that could be be considered to add to the development roadmap (obviously I'm unsure of how difficult this would be under the hood).

I'm afraid, that's currently not possible, due to the different nature of these two objects. Clouds are true volumetric objects where the light propagation is simulated through the entire volume, but the Haze itself is rather a complex post-processing effect where you can only control how far from the camera it should be rendered.

Good looking volumetric rendering for ground fog would require a bit more research and effort to make. We have similar task in our to-do list for the future releases (but at this moment with a low priority). Hopefully someday it would be implemented :)

Thanks!

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

Link to comment

Thanks for the update Silent, that all makes some sense and would be great to see it in the future.

There's no bitfield mask depth check occluder system? :p

In the mean time we can try and try out some different mechanisms and see if we can get it looking ok. 

 

Link to comment

Hi Silent,
honestly I am not sure if my comment even makes much sense, as I most certainly do not have enough understanding of how the fog works. 
but I thought maybe it could spark some discussion on whether there were some other options for making things work the current fog mechanism rather than waiting for the volume based.

my thought process was something like:

if the fog is rendered using distance from camera, would there be a way to add some geometry to  block the entrance to the tunnel for the purposes of this fog distance check only, such that the amount of fog is only what is between this geometry and the camera (already I don't know if that actually makes sense with how the fog works)

then if the fog is using the depth buffer to do this check, would this effectively be some sort of depth buffer occluder geometry,

and then to make it generic for other depth buffer checks it could  use the same bitfield mask mechanism that is used for view ports etc.

 

Link to comment

Yeah, but instead of adding geometry you can use triggers. You can place two triggers at the entrance and exit of the tunnel 1 (let's assume that it would be TUN_1_A and TUN_1_B) and keep somewhere in the code the list of previously enabled triggers. You can make them rather big, so when you actually cross that trigger you will have 5 or 10 seconds to gradually adjust haze parameters.

For example, at the start of the simulation you are in the open area, so you have empty list of triggers. When you will enable TUN_1_A trigger it would mean that you need to start haze adjustments (maybe based on the current train speed or something else), also you will store that you enabled TUN_1_A trigger in the memory. After some time you will initially hit TUN_1_B trigger, and in combination with previously stored TUN_1_A trigger it would mean that you need to restore haze parameters back to the open world.

The good part of these two triggers is that they can work in both direction without no additional logic. The only tricky part is to place these trigger boxes and adjust their sizes so you would have a time for proper haze adjustments :)

Alternatively you can just use regular mesh boxes (you can make them invisible to the train camera, but keep in intersection tests) and do a ray cast from the train head with a specific intersection mask and once you will hit your invisible box you can start haze process adjustments.

Hope that helps :)

Thanks!

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

Link to comment

Yes I think we will have to use triggers or similar for now. 

We also need a bit of care as a user can chose to start inside a tunnel, and they may stop outside the entrance of a tunnel so would need to to handle these cases but it should be achievable. 

The key point is that the behaviour of adjusting global haze settings is different to being able to adjust where haze should be rendered in the view. 

We may have a tunnel that is in the side of a hill, and is open environment to the side of it, as you come up to the tunnel, you should see fog in the open environment and only some fog inside the tunnel entrance.
If we ramp the haze settings as you come up to the tunnel, you will see the haze dissipate in the open environment as well.
If you have side windows, you can see the open environment for even longer. 

If you had a building with an open door, and you didn't want to see fog inside the building as you walk up to it this would be a similar situation. 

 

Having a way to not render the haze inside an region (the field idea) would be ideal, but I can understand this being not feasible currently. 

Having a way to at least block the distance to the camera could help on approach to the tunnel so you can leave the haze level while you see external environment while making the tunnel entrance not look like it is full of the same level of haze.
You would still need to adjust the haze once you get past this if it was a surface, so that you don't suddenly start getting haze in the tunnel again. 
It may be that there is no feasible way to to this sort of thing either, but I hope I managed to explain the use case a bit better. 

Link to comment
×
×
  • Create New...