Author Topic: Fog free interiors  (Read 53 times)

davidrodmad

  • Newbie
  • *
  • Posts: 3
    • View Profile
Fog free interiors
« on: February 12, 2021, 05:42:12 AM »
Hi, I've been reading the documentation and trying some stuff but I wasn't able to achieve what I was looking for, so I thought I'd ask here since I imagine it'd be a common situation.

I have a first person game in the built in pipeline, I want fog to be always there on exteriors, but not in interiors. The fog should still be visible outside from the windows.

What components should I use for this? Geometry masks make it so you can't see the fog from the windows (if I'm using it correctly) and fog of war seems to ignore the Y axis, which would make the fog disappear even if the camera was walking on the "roof", if I understand correctly.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6630
    • View Profile
Re: Fog free interiors
« Reply #1 on: February 12, 2021, 11:00:15 AM »
Both geometry mask and fog of war are certainly designed for third person perspective. The geometry mask has the option of making it inverted or not, so fog will appear inside or outside the volume geometry only.

In this scenario you could use:

- Fog distance option: this basically pushes the fog in front of the camera for certain distance. This is the cheapest and easiest way to avoid fog inside interiors for a first person view. Not very accurate but could work if you don't need the fog to precisely start just outside of the walls.

- Fog Void: the fog void cuts off the fog inside a volume which can be that of a sphere or a cube around a position. When entering a house you could activate a fog void inside the building with its dimensions so the fog won't render inside that volume. For best results enable the "Raymarched Void Area" inside the Shader Options section ( on top of the inspector ).

Regards


davidrodmad

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Fog free interiors
« Reply #2 on: February 12, 2021, 01:51:25 PM »
Thanks I will try the fog void when I get a chance, would it be necessary to activate the fog void on runtime, or could I just set up static fog voids for each of the buildings?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6630
    • View Profile
Re: Fog free interiors
« Reply #3 on: February 12, 2021, 05:14:50 PM »
The built-in version only allows one void area at the same time (the URP version supports 8 by default and even this number can be increased in code).
In any case, you can modify the voidPosition and size using scripting, yes.


davidrodmad

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Fog free interiors
« Reply #4 on: February 21, 2021, 03:14:49 PM »
Hi, I'm working on using the void area on Built In, and I was wondering, how do I set the bounds of it? I can see there is a void area option in the camera script that lets me set a width, height and depth, but I see no visual representation of this area. I assigned to it a game object to try and see if colliders bounds or anything were taken into account, but it didn't work.

Is there no way to see a void area of effect visually or have some way so I can measure it to fit my interior?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6630
    • View Profile
Re: Fog free interiors
« Reply #5 on: February 23, 2021, 08:47:01 AM »
A bounding box could be shown when this option is used, yes. We'll try to add this into next update of the builtin version.

In the URP version, fog voids are independent objects and their volumes are visible in the SceneView.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6630
    • View Profile
Re: Fog free interiors
« Reply #6 on: February 23, 2021, 09:01:25 AM »
A new option "Show Gizmo" has been added to latest beta. This shows the void volume in the SceneView.