Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Fog Volume 3

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

  1. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    We've been having the exact same problem for several versions - I've spent a lot of time looking into it; @JonDadley - that fix looks like what we need, but it absolutely has to be a clone of the later loaded volume?
     
  2. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Thinking: if it does need to be a clone of the later loaded volume, this sounds to me like shader variants & stripping being over-aggressive. I believe we did include via Graphics Settings the FV shaders already, but I don't know if there is others it depends on. @DavidMiranda may know?
     
  3. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    @AFrisby I can't say definitively that it *has* to be a clone but this is what lead me to think that's the case:

    I have 2 fogs in my main game scene. One has just a gradient, the other has noise and a gradient. I copied one into my hacky first-loaded scene and *that* fog would appear in the build but the second would not. It was only by cloning both fogs that they would both appear in build. It could be that you could make a new fog with the exact same settings and that would work but at that point you may as well clone them.

    Yes I suspected it could over-aggressive shader varient stripping too. I added the main FV shader to my "always includes" but it put the build time up to a crazy unacceptable level so I abandoned that.

    Either way it'd be useful to get a proper solution as this hack isn't really practical for any kind of released project that uses FV3 extensively.
     
  4. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    About to find out if stripping is the issue - I'm compiling all of the shaders into our graphics settings embed (turns out there's more than one shader here...), I'll update in 6 hours when this build finishes.
     
  5. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Well, the build has been running for 15 hours so far, and counting (43gb of shader variants ... so far) - I'm guessing FV is using keywords to enable/disable features, while there are obvious performance impacts, it'd be nice to get a 'ubershader' variant of the FV core shaders; which still computed and discarded features which are disabled to avoid this problem.
     
    matteumayo likes this.
  6. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Well, we're currently 44 hours into the build (good thing I don't need that machine for anything right now...) I'm probably going to assume this isn't going to run when it does finish compiling, currently up to 63.8gb of shader variants.

    I do have a possible solution for David (and well, us too.) - the issue we have is that the fog volumes are packaged outside the main build (with shaders stored in bundles), while the camera lives inside the main build. In our case, this is somewhat non-negotiable.

    I think it may be possible to include just the variants needed in the bundles by actually compiling the shader's SetKeywords into one flat shader with a unique name (i.e. removing the #pragma multi_compiles, and just enabling or disabling those blocks). A couple of other packages on the asset store presently do this (presumably to get around issues with SetKeywords bloating builds since 5.4).

    I did however, add a Unity feedback post for Unity reverting this nonsense with precompiled variants. Or at least supporting non-variant compiled shaders. You can read that & vote for that here: https://feedback.unity3d.com/suggestions/please-revert-shader-variant-precompilation
     
    matteumayo and Lex4art like this.
  7. malrion

    malrion

    Joined:
    Dec 23, 2016
    Posts:
    8
    Thanks for the hack! I was loading all the Fog Volumes into my bootstrap scene and then dynamically enabling them depending on which scene the user was in but that seemed even more hacky than your solution. I'll give that a shot! Is he more responsive via his email, then?
     
  8. JonDadley

    JonDadley

    Joined:
    Sep 2, 2013
    Posts:
    139
    Yes, David was pretty quick to reply to emails. I'm not sure he's getting alerts for this thread or currently has much time to check it.
     
  9. Morseliot

    Morseliot

    Joined:
    Jan 10, 2015
    Posts:
    46
    Hi David, will it work on Linux (OpenGL) ? I'm trying to make a build, but it's just keep crashing on launch, trying to understand what could be the reason, is it because of Fog Volume or something else.
     
  10. Rotecks

    Rotecks

    Joined:
    Dec 17, 2014
    Posts:
    58
    Hi David!
    Sorry for my english. I'm trying to use VolumetricFog3 with Unity Line Renderer.
    Standard LinerRenderer is drawn ONLY in the Loсal Alignment mode when FogVolumeRenderer is working on the camera. If I turn off FogVolumeRenderer, the LineRenderer's mode is (as configured in the settings) View.
    Version of Unity: 2017.2.0p4
    How to fix it?
     
  11. Salja

    Salja

    Joined:
    Mar 23, 2017
    Posts:
    326
    Assets/FogVolume/Scripts/FogVolumePrimitive.cs(3,7): error CS0246: The type or namespace name `UnityEditor' could not be found. Are you missing an assembly reference?

    When im try to build my game on newst update
     
  12. redmugstudios

    redmugstudios

    Joined:
    Dec 21, 2016
    Posts:
    60
    Hey David, have you managed to test a simple scrolling fog volume (noise and gradient enabled) on mobile?
    Could you suggest a few settings to tweak to optimized it? I build a sample scene and its only running at 9 ~ 10FPS on most mobile devices that I have tested.
     
  13. redmugstudios

    redmugstudios

    Joined:
    Dec 21, 2016
    Posts:
    60
    I also tried to disable gradient, but for some reason now the fog is not being rendered at all.
     
  14. AndrewLowther

    AndrewLowther

    Joined:
    Dec 10, 2017
    Posts:
    1
    Anyone having trouble building this for live remove the "using UnityEditor" in FogVolumePrimitive.cs and it will fix your compilation errors. It's not used in that file anyway.
     
  15. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    170
    I can't help but notice that David hasn't posted here since mid-October - is there a different forum I'm not aware of? I asked a question quite awhile ago and have yet to receive an answer.
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,069
    Probably best to send an email to his support email address. He may not be getting notifications of posts on this thread.
     
  17. oumur

    oumur

    Joined:
    Sep 12, 2013
    Posts:
    10
    this product is misleading. Everything that is build is TINY in scale. in a normally proportioned screen the clouds look like S*** because in order to get them not to repeat you have to set the scale of the noise very low after that the detail layer is just not enough to get a decent look.
    if i apply all the settings in the tutorial i get small puffy repeating clouds. and i cannot scale that with normal transform.

    or im missing something.

    @Unityaware thats a unity zoom factor issue it often goes away if you "scroll out" with your mouse wheel.

    edit: Ok i figured it out but the sliders leave too much space for completely going into the wrong direction.
     
    Last edited: Dec 20, 2017
  18. oumur

    oumur

    Joined:
    Sep 12, 2013
    Posts:
    10
    anyone has any idea how i can solve the issue in the first picture.... i have a downscale of 2 and use depth because if i dont the clouds get cut off in a visually weird way (as if they were only one layer of bilboard (like in the second picture)
    the only option i found was to use no downscale which is just too expensive for VR

    depth_trees.JPG no_depth_trees.JPG
     
  19. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    In the latest version you will find subtractive primitives. The subtractive mode is what you need to open a whole in the middle of the cloud.
    2017-12-20_16-38-50.jpg
    World distance is not what determine performance. The GPU doesn't know about distance, only about operations per pixel.
    Skydome? Do you mean the skydome material? No issues with that.
     
  20. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    1. That was explained in the documentation
    2. I never said that Fog Volume is a Time of day, sky thing.
    3. Okay, I stop here, I totally lost the motivation to continue with this
     
    snacksarecool and Lex4art like this.
  21. redmugstudios

    redmugstudios

    Joined:
    Dec 21, 2016
    Posts:
    60
    Hey David, are you're going to stop the development? Personally, the asset is great for what its purpose. Its probably one of the best, if not the best volumetric fog solution on the store right now
     
  22. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    Thanks, mate.
    No, I won't stop the development. I just had to stop replying that message, and the others. I will be replying them in the next days.
    I have tested it, yes, but with the same results than you. As noted here , uniform fog is the only type that can run smoothly on mobile.
     
    blitzvb likes this.
  23. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    That's a bit problematic. If I package everything together, the package will be too big. If I were a customer, I would like to import only the base one. And the smaller, the better. Also,my upload speed is really bad, around 20kb. So dropbox is the most comfortable platform.

    That's 100% possible. I can add that to the planning.

    Fog Volume works fine with prefabs. It will try to find what it needs to work, which are: one camera and one directional light:

    The GPU power required depends on the settings you use. If you use uniform fog, it will be super light. For now, webgl is not supported.
     
    Inspeinre and wetcircuit like this.
  24. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    Not being shown in builds should be fixed now with the latest version.
    About timings, it takes a long time sometimes. The problem comes from the crazy amount of shader variants. The only trick I know is to comment those that you won't use. This also makes me to rethink when to add one more option. Because of that, Im using more ifs lately. Dirty but we have no choice.

    Hi,
    That was motivated mainly for the bad management of the store with comments and ratings. Comments from version 1 were shown as if they belongs to the current version. Pretty bad. If you want, I can make you a discount to purchase from my webpage. Mail me your FV2 invoice.

    Heya. Well, writing a custom attenuation function... yes, ofc. I just need the math to do that ;)
     
  25. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    Yes! We had to introduce some limitations with the amount of lights and primitives allowed, but yeah :D

    This is fantastic. I vote to include your scenes in the package. What do you think? :)
    Yes, that's it, the camera has to be children of another. That's how it works.
    Brilliant! wetcircuit has officialy got her master degree on FV3

    That effect is already implemented as you can see here. It has nothing to do with light, it is just a postprocess based on fog density. VR compatible, yes, at least it was months ago :)

    Is that fixed in p4?
     
    matteumayo and blitzvb like this.
  26. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    570
    Okay, I have introduced some improvements to that part. It will be possible to move that object to another place. Thanks.
     
    wetcircuit likes this.
  27. ViktorCor

    ViktorCor

    Joined:
    Jul 22, 2012
    Posts:
    10
    Hi David!

    For a project I work on, I want to make a flight in clouds, but have encountered a problem:
    If I have a camera in the cloud volume I could see a rectangular hole. I think it happens because the far clipping is too small. But I can`t change clipping in this project and need clouds without a serious limitation by distance.


    I have two ideas for fixing it:
    a) Have a "fix cloud position mode" with float box. Then I can link volume by x and z-axis to my camera and fly unlimited. For example, move a small volume like a mask:
    - link to a video
    b) Or have an offset parameter(like the scroll but without time) and set it myself through code.


    Best,
    Viktor
     
  28. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    I had the same problem with fog volumes not showing up in build, Will update and try again.

    Now regarding fog volumes, I got a question that I can't find a clear answer for in the documentation.

    I am using simple uniform fog volumes, around 5 of them. When I'm inside of them, it causes my particles to be almost invisible, as if they blend with the fog.

    What would be the best way of seeing my particles like I should, dear FV3 users / David ?

    Thanks.
     
    Last edited: Jan 7, 2018
  29. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    I updated Fog Volume to the latest version.

    Turns out it is still acting weird once built. I have a uniform greyish fog, and not only they appear only when visibility is significantly lower, but they also appear uniformly white. Not at all like I am seeing it in editor play mode. here's some screenshots.
     

    Attached Files:

    Last edited: Jan 7, 2018
  30. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Hey David -

    Could you consider editing the .shader from within a .cs script directly? (literally writing the variants to disk as separate .shaders) - this'd get it to work with assetbundles (which it doesn't behave right now due to variants) - it's a bit messy, but it does mean you could go crazy with the options without worrying about variant messes.
     
  31. Mr-Papaya

    Mr-Papaya

    Joined:
    Dec 13, 2015
    Posts:
    2
    Hi all, could anyone explain please the way gradients textures are applied to Fog Volume? (specifically, one without Volume Fog). I understand the way alpha channel is processed (pretty straight forward), but the blending mode of the texture itself, affecting hue, saturation and value (to a smaller degree) remains mysterious to me. Also, using a smaller, tileable texture creates a different effect than using a larger texture that simply tiles said texture (this may have to do with the dimensions of the fog volume being asymmetrical to those of the texture).
     
  32. unitynewcomer

    unitynewcomer

    Joined:
    Mar 21, 2015
    Posts:
    5
    Hey everyone, mine is probably the simplest question so if anyone can answer it kindly, I'll be thankful.
    I have imported the fog volume asset into my unity project but I can't see any option in the editor to create fog volume.
    I don't see any prefab within the fog volume asset folder either, that I can drag and drop into the scene..
    Maybe I'm missing something very simple but I have tried downloading the asset and restarting unity but nothing works.
     
  33. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,420
    Have you looked in the GameObject->Create Other menu?
     
  34. unitynewcomer

    unitynewcomer

    Joined:
    Mar 21, 2015
    Posts:
    5
    I checked under GameObject but no menu called "create other" exists, or any menu containing fog volume.

    As a side note: I used to have fog volume working randomly one time before in my last project.. But in my current project I can't get it to work/install.. :(
     
  35. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,187
    If it is installed, you should be able to Control-click in the hierarchy and the create Game Object will appear. Under "Create Other" is where you should see Fog Volume.

    Screen Shot 2018-01-11 at 7.06.05 AM.png
     
  36. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
    Hello, crazy fact for those who have problem showing Fog in builds :

    Sometime (not work all the time) disabling "fog volume renderer" component on camera before lauching building process solve the problem. Note the building process automaticaly enable this component so you have to disable it each time you build.

    You can also set the "Downscale" of the "fog volume renderer" to 1. This trick work all the time but is very bad for performences.

    Note : I am using fog vol v3.2.1p4

    Hoping this problem find a definitive solution...
     
    Hexalted likes this.
  37. liven999

    liven999

    Joined:
    Oct 7, 2015
    Posts:
    18
    One more tips for same problem : restart unity before building can help
     
  38. danielesuppo

    danielesuppo

    Joined:
    Oct 20, 2015
    Posts:
    168
    Thank-you liven999 !!!
    I just was getting crazy with this problem!
     
  39. unitynewcomer

    unitynewcomer

    Joined:
    Mar 21, 2015
    Posts:
    5
    That did not work but I deleted the whole folder and reimported and this time it worked :D
    I had tried reimporting before which didn't work. The only thing different this time was that I removed some error giving scripts from my project, cleared the log and then reimported fog volume. And this time it's working, I can see the create Fog volume button now :D
     
    wetcircuit likes this.
  40. thijslinssen

    thijslinssen

    Joined:
    Mar 11, 2015
    Posts:
    6
  41. AFrisby

    AFrisby

    Joined:
    Apr 14, 2010
    Posts:
    213
    Hey everyone -

    I shot David an email about this, but there is a relatively simple fix to this issue I discovered.

    In FogVolume.cs CreateMaterial() there is a line which sets HideFlags to DoNotSave - removing this line, and forcing FV to recreate the materials (restarting Unity'll do) will cause it to behave correctly when exporting/building.
     
    BlandonDu and Lex4art like this.
  42. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    Thank you!
     
  43. kulesz

    kulesz

    Joined:
    Jul 1, 2012
    Posts:
    127
    Can I change the color of noise? Seems that setting FogMainColor sets color of the "uniform" part only, not the noisy one.

    upload_2018-2-12_15-33-27.png
     
  44. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    I tried that , Still getting all-white fog volumes.
     
  45. TheTaj

    TheTaj

    Joined:
    Jun 26, 2014
    Posts:
    10
    FogVolumeErrors.PNG
    I just downloaded and imported this asset into a 2017.3.0f3 project. Is this asset not yet updated to run on the latest version of Unity? Do I have to downgrade this project to use this asset?
     
  46. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    I also tried disabling the fog volume renderer before building, as well as rebooting unity before doing the build. Not working. I guess I'll have to find another solution...
     
  47. Frank-1999-98K

    Frank-1999-98K

    Joined:
    Jun 30, 2015
    Posts:
    13
    Hi, I've seen your Asset on the store and it looks amazing but before actually buying it, i'd have a couple of questions:
    1) Can i use it on an openworld as only a cloud system without losing too much performance?
    2) Can it be rendered from multiple cameras?
    3) Is it compatible with Unity 2017.3?
    Thank you in advance.
     
  48. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,187
    1).... The short answer is "yes, but it takes a little effort…" – essentially losing features that give the fog shadows and colors, as well as smooth slices. That doesn't mean it looks bad. It is a simplified version of the fog system (and the interface hides entire sections when they are toggled off). You still need to be cutthroat with the volumetric settings to get the frame rate, and then build up the noise (and there are a LOT of settings) until you get it looking whispy and natural again. Just my opinion: the clouds that give you great frame rates somehow aren't just a matter of turning off bells and whistles, you'll need to rethink the aesthetics and build clouds that look good within the limits and with fewer depth layers…. This is a completely procedural system, so adjusting the scale in one setting is a rabbit hole of adjusting other settings to balance. It's not as if you can just click some buttons and get the "lite" version of the presets.
     
    Last edited: Feb 15, 2018
  49. Lex4art

    Lex4art

    Joined:
    Nov 17, 2012
    Posts:
    196
    Hmmm, for me it was fine (did my H++ project on Unity 2017.3.0) - no errors on import.
     
  50. marcrem

    marcrem

    Joined:
    Oct 13, 2016
    Posts:
    176
    So... support for FV3 is dead?
     
unityunity