Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Fog Volume 3

Discussion in 'Assets and Asset Store' started by DavidMiranda, Jan 30, 2014.

  1. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Well, these names are more or less descriptive, matching the inspector names. DF corresponds to primitives, that one was not descriptive. I don't like either having such big amount of variants, but that was the only way to make the plugin flexible, with many options. I wish there was a better way.
    But the idea is simple, if you are not going to activate volumetric shadows, comment this line:
    #pragma multi_compile _ VOLUME_SHADOWS
    If you don't need lights, comment this out
    #pragma multi_compile _ ATTEN_METHOD_1 ATTEN_METHOD_2 ATTEN_METHOD_3

    And so on. Hopefully you will only need to remove a few.

    Sorry for the inconveniences. I understand and share the nuisance.
     
    dsilverthorn likes this.
  2. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Humm, yes. It was designed like that for good reasons. But it is possible to hack this. Find this function: void MoveToLayer() And comment out the layer assignation.
    FogVolumeGameObject.layer = LayerMask.NameToLayer("FogVolume");

    Note that some functionalities may not work such as shadows (received from another fog volume) or lowres rendering.
     
    dsilverthorn likes this.
  3. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Didn't it? It always worked fine with reflection probes
     
  4. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Humm, weird. I just loaded a fresh project and created one, and it is fine. even the lowres script in the camera works correctly. Console is clear 2020-02-24 19_38_10-Clipboard.jpg
     
  5. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Mobile is very problematic. In principle there is nothing special to do, but only Uniform Fog Volume (default setup) will work with certain guarantees. Is your volume uniform? (without noise or gradients enabled)
    The type is shown at the bottom of the FV inspector
    2020-02-24 19_51_29-Clipboard.jpg
     
  6. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,166
    One package that I can recommend to solve the issue of too many keywords being used is: Shader Control by Kronnect. What this does is basically give you an UI to manage shader keywords by commenting them in/out.

    @DavidMiranda Have you looked into using local shader keywords? They have introduced that kind of recently (not sure if in 2018 or 2019). See also: https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html (section "Local keywords").
     
    dsilverthorn and Hawk0077 like this.
  7. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,862
    No it didn't show up in reflection probes.
     
  8. tarrabass

    tarrabass

    Joined:
    Jun 4, 2015
    Posts:
    15
    Hello
    i have a issue on Unity 2018.3.0f2
    cloud work perfectly on editor but doesn't work on built
    do you have any idea ?
     
  9. ericthelander

    ericthelander

    Joined:
    Jan 15, 2018
    Posts:
    1
    I had the same issue. The workaround I came up with was that you need to have the game window active when building. My workstation has two monitors and I have the editor window on one monitor and the game window on the other. This resulted in a faulty build. Restore the window layout with the editor and game tabbed and have the game window active.

    Best of luck!
     
    laurentlavigne likes this.
  10. jfml

    jfml

    Joined:
    Mar 8, 2018
    Posts:
    5
    Hi, sorry if this has been answered before but I guess it's not possible to have primitives with different colors? I'm blanking on how to achieve this (accept for maybe with lights?). Thanks a lot in advance!
     
    Last edited: Mar 31, 2020
  11. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    It works

    Do the following:
    1. make the FV you want to be reflected to be visible by the probe 2020-04-09 12_01_02-Clipboard.jpg

    2. Make the surrogate layer invisible for the probe
    2020-04-09 12_01_25-Clipboard.jpg

    Done
    2020-04-09 12_03_25-Clipboard.jpg
     
    dsilverthorn, Seneral and wetcircuit like this.
  12. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    I found the issue. Go to FogVolumeRenderer.cs and comment out lines 784 and 787
    2020-04-09 12_17_03-Clipboard.jpg
     
  13. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,862
  14. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    2,862
    Nebula 3 Volumes rotate and translate with w and e.
    scale doesn't do a thing.
    If I parent the cubes defining the volume then scale them, the 3D pattern doesn't follow the scaling
    how do you scale such volume?
     
  15. marcoSquad

    marcoSquad

    Joined:
    Jan 23, 2020
    Posts:
    2
    I'm having trouble getting the sphere primitives to work. After a lot of struggle I managed to get the desired result, I have one fog volume using a single sphere primitive and another using the max amount of 20. They are both looking fine in the editor now, but in an actual standalone build they both look like cubes, exactly the way they look in the editor if I turn off the use primitives setting. I logged the amount of primitives used with GetTotalPrimitiveCount and GetVisiblePrimitiveCount and I'm getting 1 and 20 as expected. Do you have any other idea what might be the problem?
     
  16. marcoSquad

    marcoSquad

    Joined:
    Jan 23, 2020
    Posts:
    2
    I've found that this behavior only happens when you instantiate a prefab fog volume. If you have it in the scene already, it works fine.

     
    dsilverthorn likes this.
  17. jfml

    jfml

    Joined:
    Mar 8, 2018
    Posts:
    5
    Hi, is there a way to not optimize (I guess that what's going on?) FogVolume-primitives when you zoom out:

    upload_2020-5-1_8-41-21.png

    I'm trying to do an astronomy related simulation with nebulas and it would be cool if there was a way to make them look more detailed from far away. Is there a way to achieve this?
     
  18. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    78
    Hey everyone Whats the name of this method??
    The transition i mean
     
    Last edited: May 6, 2020
    wetcircuit likes this.
  19. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    370
  20. XANTOMEN

    XANTOMEN

    Joined:
    Dec 18, 2012
    Posts:
    21
    I subscribe to that. I'd definitely buy this asset if it worked on URP and kept the primitive boundaries feature functional :D
     
  21. invictus24

    invictus24

    Joined:
    Sep 17, 2017
    Posts:
    2
    Hey, can I use this volume fog in HDRP?
     
    Skotrap7 likes this.
  22. Skotrap7

    Skotrap7

    Joined:
    May 24, 2018
    Posts:
    32
    Would love to know this too. Bought this asset a long while ago, and would love to continue using it on HDRP.
     
  23. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    The scale is modified in FV inspector. Unity's transform scale didn't work well
    2020-06-30 10_20_27-Clipboard.jpg
     
    laurentlavigne likes this.
  24. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    Yes, that's the detail layer draw distance
    2020-06-30 10_25_59-Clipboard.jpg
     
    wetcircuit likes this.
  25. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    575
    @XANTOMEN @invictus24 @Skotrap7
    At the moment I don't plan to put my hands on URP. I have spent some days studying it, but it is a giant wall. It is like starting to learn graphics again from scratch. That doesn't make anyone happy or motivated.
     
    XANTOMEN likes this.
unityunity