Author Topic: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?  (Read 1503 times)

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Hello,

I'm making a topdown shooter and want to achieve an effect exactly like in your BookoftheDead demo.

I've tried for hours to get fog volumes to work - to either include or exclude fog.

Even in a brand new, empty project, I get this error when trying to 'create other --> fog volume'

Code
Could not load DynamicFogVolume from Resources/Prefabs folder!
UnityEngine.Debug:LogError(Object)
DynamicFogAndMist.FogVolumeExtensions:CreateFogVolume(MenuCommand) (at Assets/DynamicFog/Editor/FogVolumeExtensions.cs:12)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

If I drag the fogvolume in manually, it does nothing.

Here are my settings:

https://imgur.com/AQ0XvkW

2017.4.22  -- Windows 10  -- PC Build (not VR)

What am I doing wrong?
« Last Edit: March 07, 2019, 10:13:07 AM by Richard_E »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #1 on: March 07, 2019, 10:21:44 AM »
Hi,

Dynamic Fog & Mist is available as an asset on the Asset Store but also included in Volumetric Fog & Mist.
In order to verify that error, could you please tell me if you're using the asset or the copy  included in the Volumetric Fog & Mist packege?

Thanks

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #2 on: March 07, 2019, 10:32:53 AM »
Hi,

Dynamic Fog & Mist is available as an asset on the Asset Store but also included in Volumetric Fog & Mist.
In order to verify that error, could you please tell me if you're using the asset or the copy  included in the Volumetric Fog & Mist packege?

Thanks

Dynamic Mist only.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #3 on: March 07, 2019, 11:11:47 AM »
Thanks, will check this immediately.

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #4 on: March 07, 2019, 11:20:31 AM »
I can confirm this error occuring in Dynamic Fog & Mist for Unity 2017.x package. It does not occur in Unity 2018.x.
The culprit is the prefab "FogVolume" has a wrong name - it should be called "DynamicFogVolume". This change was not propagated correctly into this version. Apologizes for that.



Fix: please rename the prefab from "FogVolume" to "DynamicFogVolume" and try again. The fog volume should be created.
The fix will be submitted to the Asset Store shortly.

fyi: fog Volumes are just "areas" that control fog appearances. In Dynamic Fog & Mist they don't limit the size of the fog to that area but they can control every property like fog distance, distance fall off, height, etc.
In Volumetric Fog & Mist volumes, a fog area can be used to create a local area fog.

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #5 on: March 07, 2019, 03:12:12 PM »
That fixes the small problem, but I still cannot 'carve out' an area with different levels of fog.
(Even if the fog is still being rendered but the alpha level is set to zero for a specific area via the fogvolume - no problem - the apparent effect to the end-user is the same: different parts of the level have different amounts of fog.)

Is this simply a feature which is not available in the Dynamic version?

How exactly did you achieve this effect with the BookoftheDead demo?

https://youtu.be/6XSYmO8QZ-c?t=25
« Last Edit: March 07, 2019, 03:14:18 PM by Richard_E »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #6 on: March 07, 2019, 03:26:39 PM »
Using different fog volumes with different profile sets.
Check out this video: https://youtu.be/oB1tQEXEISM

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #7 on: March 07, 2019, 03:56:11 PM »
Ok, to be specific, here is a screenshot from my topdown game. The camera and playable character don't really move (like tower defense) and its not an FPS.

How can I give the appearance of fog (or not-fog) in one specific area and not others?

https://imgur.com/1UNSAAA

Or like precisely at this time in your video:

https://youtu.be/6XSYmO8QZ-c?t=36
« Last Edit: March 07, 2019, 03:58:02 PM by Richard_E »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #8 on: March 08, 2019, 12:21:48 AM »
I see, you refer to the "fog of war" feature!

Here's a quick tutorial on how to setup and use the fog of war option:
https://youtu.be/TpAWEQOHfmw

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #9 on: March 08, 2019, 10:51:41 AM »
If I have to go in and create scripts, its not really suitable. I just want to set a global level of fog, and then use fog volumes (or whatver) to carve in or carve out areas of fog. This seems like a pretty core feature that a customer would want to use.

How were the MarzRising fog areas achieved? Was that via the Volumetric Fog asset?

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #10 on: March 08, 2019, 11:41:15 AM »
Yes, you can add chunks of fog using Volumetric Fog & Mist as shown in this video:
https://youtu.be/ENctjfMsjlQ

However it's not the most performant way if you have dozens of chunks in the view. MarzRising and other games use the fog of war option of Volumetric Fog & Mist using either scripting or passing a transparency mask using Photoshop (or any other graphic tool like GIMP) drawing and erasing on top of the playground or terrain texture reference. Then they export this layer as a texture where the alpha component defines the fog opacity and then they pass the mask contents to the fog asset using fogOfWarTextureData property:

Code
Texture2D myMask;
...
Color32[] colors = myMask.GetPixels32();
VolumetricFog.instance.fogOfWarTextureData = colors;

So you can use the fog areas approach on the video (which does not use the fog of war feature) or use the fog of war scripting or mask approach above.

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #11 on: March 11, 2019, 08:49:53 AM »
Mate, just tell me to download (and pay for) Volumetric Fog and mist :-D

I achieved the effect I wanted in a few minutes with fog void.

I think your BookoftheDead video is misleading... that effect cannot be achieved out of the box with DynamicMist.


Edit: mostly achieved. How do I rotate the fog void box?
« Last Edit: March 11, 2019, 09:16:16 AM by Richard_E »

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #12 on: March 11, 2019, 08:58:01 AM »
Glad you got it working! Please note that the effect you see in Book of the Dead is 100% using Dynamic Fog & Mist and first person view. For a 3rd person view, yes, it's not easy to achieve - better to use Volumetric Fog & Mist.
Cheers

Richard_E

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #13 on: March 11, 2019, 09:17:59 AM »
No answer to this that I can find via search:

How do I rotate the fog void box? :-(

Kronnect

  • Administrator
  • Hero Member
  • *****
  • Posts: 5390
    • View Profile
Re: FogVolumes not working - 2017.4.22 Dynamic Fog - topdown effect?
« Reply #14 on: March 11, 2019, 09:26:39 AM »
Fog areas and fog void are AABB. They can be scaled or moved but not rotated.