Author Topic: Inverse Fog Voids for Volumetric 2 URP?  (Read 1082 times)

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Inverse Fog Voids for Volumetric 2 URP?
« on: May 20, 2020, 02:17:02 AM »
Hi Kronnect!

I just upgraded to Volumetric 2 from the great Volumetric Fog & Mist package, as my current project is on URP.
It looks like another of your well-made, juicy effects that we all love.

Now, I was wondering, as I can't find information about the plans with Volumetric 2 in the forum (I think I'm the first Volumetric 2 post!): Is there plans to bring in some form what was at some point Inverse Fog Voids (later Fog Areas) to Volumetric 2? And what about other features, such as Geometry Masks, or the Follow GameObject fields on those (I know, one can just parent or do the follow oneself, but it is neat having it already there)?

In reality, while I'm curious about the general plan, my question is more oriented to knowing when/if we will be able to restrict the Fog Volume to be contained within an area, for the needs of my current project. Basically, I need the clouds to be confined inside a transparent sphere I have, and not show up outside of it. Not to fill up the whole sphere however, so something like the inverse of the current Fog Void seems perfect, then I'd just need to give it the same radius as my sphere and voilá. I tried with careful use of Fog of War, but the result isn't great, and it constrains me to very specific values for noise and so on.

Use case Scene: https://gyazo.com/71d9e0ec0aa621f129b1398cb0d1557a

If it's not a feature planned for the near future, I'll try my hand at hacking it taking ApplyFogVoids as a template.

Thank you!

EDIT: Couldn't resist and did a quick test, adding a line (alpha = 1 - alpha) at the end of ApplyFogVoids. That's when I realised the error of my ways, as FogVoids don't seem to have an effect on the vertical axis of the clouds. Would take longer to hack than I thought xD.

« Last Edit: May 20, 2020, 11:37:48 AM by Xanto »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #1 on: May 20, 2020, 06:41:51 PM »
That's a nice suggestion indeed and sure! it'll be added soon.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #2 on: May 25, 2020, 10:59:23 AM »
Latest beta includes a new Boundary section which now supports box (default) and sphere boundaries. The radius of the sphere is driven by the transform scale.x value.
Also, a Vertical Offset is present, which shifts the fog layer within the boundary. For instance, you can now limit the fog to a spherical volume and shift the fog to the ceiling part of the sphere.
Give it a try and let me know your thoughts!

p.s. you can disable fog voids as these new options do not affect them.

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #3 on: May 29, 2020, 12:53:24 PM »
Hey Kronnect!

Thank you very much for trying this out, I appreciate it very much :D

I tested it out for a while, and will try and be clear about my opinions / findings (which I realize are hard for me to verbalize). Please ask for clarification if it's confusing:

So, I think this isn't what I had in mind for my use case. I think it could be argued that the current solution only presents no visual problems if the Sphere cloud is intended to fully adhere to the borders of the 'room' sphere. Meaning, if the x scale is the same as the contained Sphere and the boundary is 0. Shown here:

https://gyazo.com/6f7325d1083e024937a9b4f02d0a4589

Whereas in my mind, the intent was more that you could have the cloud volume set up, which could be smaller than the 'room' sphere, but if it reaches the border of the room sphere it'll be cut off (and if it doesn't reach it, then the sphere boundary really has no visual effect). So, it's less that the cloud volume would be generated from a sphere, and more that it would be constrained by one IF some part of it would try and sneak outside. So, in terms of visual logic, kind of what happens to the rocks or the terrain in this scene (which is a clip effect plus some trickery to make them look like volumes and not hollow meshes):

https://xantomen.com/wp-content/uploads/2020/05/dreamspaces_rock_slice.gif

For reference, this is the closest I've come to the visual result I'm thinking of:

https://gyazo.com/8915c26a0ecc97db38dc33ffe0be4f8e

So, I made the sphere volume smaller, repositioned it, set the boundary to 1 and vertical offset to 0 because it was the only way I could make it look like a cloud smaller than the 'room', that doesn't look cut by an invisible spherical boundary (at the sides or the top). Which in the end, presents a similar problem to the situation before this beta, as then the current sphere volume boundary is different to the room boundary, and so you may have clouds going beyond the room limit (horizontally or vertically).

Of course, you could then size and position the volume so it's smaller than the room, which ensures that no cloud will be beyond room limit, but it does limit your options quite a bit, and still means the cloud would get cut by an invisible spherical boundary, different to the room boundary:

https://gyazo.com/fc68c1afec4a89045e0b7d45844e0936

If attempting not to do that, and use the variables as intended, then this is the best result I'm being able to produce, in which I painted in red the obvious invisible sphere contour cut in the Game View:

https://gyazo.com/40fc9a89696461357330afc3495645a8

Also, I should mention in case it's at all relevant and probably worth documenting / automating if the feature releases out of beta: For the current cloud volume to have a spherical shape one needs to set the Mesh Filter to Sphere as well, not just the Boundary setting.

For contrast, the way the Fog Voids work (or even the Fog of War), it does look more like a defined boundary to a cloud that otherwise looks normal. (The limitations on those being that there is no Invert Fog Void and that Fog Voids / Fog of War only care about x and z but not y).

In short, I think this is a neat use case too, just not what I personally had in mind. :)

Thank you again! Please do tell if that's not a feature that will happen :)

EDIT: This is pretty much what I was looking for, except the clear invisible cut border on the top and sides makes it look bad. So maybe what I was thinking about was achievable when tweaking variables in the right way and the only extra thing needed for 'contained cloud effects' is a 'border noise' or 'apply noise (from the Density options) to border' option: https://gyazo.com/e09ee93cfc25e1d8cb3feba72f83d31b
« Last Edit: May 30, 2020, 01:48:35 PM by Xanto »

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #4 on: May 30, 2020, 02:37:39 AM »
Playing more with the Noise and Distance values I've managed to come to a look that goes closer to what I had in mind, and meanwhile I found another thing you might wanna know.

With certain values, there is some spherical lines showing up in the texture. Such imperfections don't show up when changing Boundary shape to Box (other small line-like imperfections appear on borders of the cloud). Such are more obvious the least dense a specific part of that cloud ends up being, normally achieved through the Distance or Density parameters. The two main values that seem to alter these imperfections for the good (other than changing to Box) are raising Raymarching quality and Jitterring. I put Dithering and Jittering to 0 and 0.01 respectively before because otherwise they cause some 'pixelated' look on the cloud surface. Raymarching quality I have at 6 in the pictures.

Boundary Sphere:

https://gyazo.com/9010099cf165cc4a0b6866d664b38a0e

Boundary Box:

https://gyazo.com/471cecacf6e7868be2dca0ea369e2e6b

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #5 on: May 30, 2020, 02:32:33 PM »
Those banding artifacts should disappear pushing jittering to the max.

Next version will also include inverse fog voids option for greater flexibility.

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #6 on: June 02, 2020, 11:44:03 AM »
Those banding artifacts should disappear pushing jittering to the max.

Next version will also include inverse fog voids option for greater flexibility.

Ok nice, thank you for your help! Will those Inverse Voids limit Y as well, or only XZ as the current Voids?

On the meantime I had the idea of using the Sphere Boundary settings as is and try to use the density noise to make some sort of 'border noise' as well (always towards the inside, to respect the boundary), so the boundary isn't that sudden when Border is being used. I didn't manage to however, everything I did looked either weird or didn't help the 'invisible sudden boundary' visual by much.

I think had I managed to solve that I'd be set, as I feel it's the only ingredient I'm missing from this result I already achieved: https://gyazo.com/e09ee93cfc25e1d8cb3feba72f83d31b

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #7 on: June 02, 2020, 11:58:27 AM »
After some testing, it turned out inverse fog void doesn't make sense (or isn't optimal):

1) Only one inverted fog void makes sense (you could think of several inverted fog voids).
2) It's less performant than the sphere shape.
3) Could be confusing if mixed with other fog voids or fog of war feature.

So the current effect with sphere boundary would be the best choice right now. Is there anything that you would add or retouch to make it better?

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #8 on: June 02, 2020, 12:18:12 PM »
After some testing, it turned out inverse fog void doesn't make sense (or isn't optimal):

1) Only one inverted fog void makes sense (you could think of several inverted fog voids).
2) It's less performant than the sphere shape.
3) Could be confusing if mixed with other fog voids or fog of war feature.

So the current effect with sphere boundary would be the best choice right now. Is there anything that you would add or retouch to make it better?

Ok that's complete fair. Thank you for exploring the option! The sphere volume was a great idea that hadn't occurred to me when starting the request :)

To make it better, I can currently think of the border noise / radius fade described on my last post as the one improvement that makes the Border variable make visual sense. That is, if through that it's possible to maintain some of the fluffiness of the cloud on the invisible borders without having it surpass them (or defining a min/max boundary so the border can fall somewhere between those, rather than the max boundary alone).
« Last Edit: June 02, 2020, 02:04:42 PM by Xanto »

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #9 on: June 09, 2020, 10:47:23 AM »
Would this Border Noise / Radius Fade idea be something you will consider including?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #10 on: June 09, 2020, 06:45:15 PM »
Try latest beta's detail noise options.

Xanto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Inverse Fog Voids for Volumetric 2 URP?
« Reply #11 on: June 13, 2020, 01:56:35 PM »
Ah! This is definitely an improvement, for sure :D

https://gyazo.com/22012c334beeaf8f350374d9d731e2ae

It isn't ideal in the sense that, it being a noise that affects both the 'bordered' area and the part that isn't hitting a border equally, when you crank it up to make the border noisier, you are also going to make noisier the area that already looks as desired, so you can never reach a sort of equilibrium if a border is in effect.

But I can definitely use this :)

Thank you very much!