Author Topic: Seeing fog through solid objects  (Read 138 times)

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Seeing fog through solid objects
« on: October 17, 2020, 02:47:25 AM »
Windows 10
Unity 2020.1.8f1
Volumetric Fog & Mist 2 - 2.4.2
URP

I have made some nice moving clouds that I would like to see outside of my airplane window, however I am also seeing them through the walls and floor.

Demo:
https://imgur.com/a/bnOGnBQ

Maybe I messed up some setting or something?  Any ideas?

Thank you.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #1 on: October 17, 2020, 09:00:17 AM »
Are the walls using a transparent shader?
Try the option:  Render Before Transparent in the Volumetric Fog & Mist inspector.

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #2 on: October 17, 2020, 07:31:20 PM »
Hello,
That was with no shaders.  I created a new scene, made a cube, resized it, and added fog.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #3 on: October 18, 2020, 08:55:48 PM »
Does your URP asset have the "Depth" option enabled?
If you select the Volumetric Fog Manager or your Volumetric Fog volumes, do they show any warning in the inspector?

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #4 on: October 19, 2020, 01:25:19 AM »
Depth Texture is enabled, and I don't see any warnings in the inspector.
Thank you for trying to help me figure this out.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #5 on: October 19, 2020, 06:59:47 AM »
Can you send  a test repro? There must be some setting wrong.

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #6 on: October 22, 2020, 01:51:11 AM »
Sent!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #7 on: October 22, 2020, 01:31:32 PM »
Thanks for the repro.
You have to enable "Depth Texture" option in the URP pipeline asset. If you select the Volumetric Fog Manager in the inspector, it will warn you about this..

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #8 on: October 22, 2020, 05:18:43 PM »
Oops, my bad.  It definitely is enabled in my project though.  I will see if I can reproduce it and send..

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #9 on: October 22, 2020, 08:59:34 PM »
Ok, sent again.  Thanks!

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #10 on: October 23, 2020, 08:40:48 AM »
Hello and thanks again for the repro.

I tried your project using Unity 2010.1.10f1 and it works fine.
Here's a video: https://youtu.be/NU_9oe2fFDA

As you can see, the cube correctly occludes the fog both in SceneView and GameView. Same results on both Mac and Windows.

Could you try using this Unity version?

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #11 on: October 23, 2020, 08:46:21 PM »
Did you mean 2019.1.10f1?  I do need at least 2019.3, but I will test it with that soon.
Thanks again.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #12 on: October 23, 2020, 09:05:32 PM »
2019 LTS should work as well. Please let me know if problem persists using latest 2019.4 (LTS).

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 6214
    • View Profile
Re: Seeing fog through solid objects
« Reply #13 on: October 23, 2020, 09:07:55 PM »
Also, make sure you update to latest URP version in your Unity version from the package manager.

bc732

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: Seeing fog through solid objects
« Reply #14 on: October 24, 2020, 09:06:59 PM »
Ok, 2019 LTS works fine, so that's great.

Are you planning on making the asset compatible with 2020 releases?