1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. We want to know how you learned Unity! Help us by taking this quick survey and have a chance at a $25 gift card
    Dismiss Notice
  5. Are you an artist or level designer going to Unite Europe? Join our roundtables there to discuss artist features.
    Dismiss Notice
  6. Unity 5.6 is now released.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice

[RELEASED] Fog Volume 3

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

  1. Harekelas

    Harekelas

    Joined:
    Feb 3, 2015
    Posts:
    176
    Got it, thanks for reply!! :)
     
  2. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    Supper happy today. Finally I can say this:
    2017-06-10_21-49-47.jpg
    I switched to a different method, as the previous one was giving me too much headache. Instead of packing both eyes in the same texture, I use 2 now. Didn't find enough examples of the first one to learn from. But for the second method there are some official samples from htc that made this a lot easier to understand.

    The other happy new is that SteamVR is not needed now. I found built-in replacements for all the stuff I needed. So uncommenting code is not part of the process now :)

    Here are my 4 textures:
    2017-06-10_21-50-45.jpg
    3.1.9 will be submitted next monday.

    Yai!
     
    Lex4art, punk, radimoto and 1 other person like this.
  3. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    54
    Amazing!

    Does this mean volumes in the scene in VR is now supported? If I read what you said earlier correctly, in VR FV3's functionality was limited to the skybox/background clouds only? (no depth)

    So does this new update enable that?

    (Sorry if I misunderstood. o_O)

    Either way, great work!
     
  4. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    I probably described that scenery as the most safe, but depth was always enabled (optionally) And causing issues here and there too :) In that situation we avoid all the limitations with transparencies and we can optimize a lot. When we have clouds colliding with the scenery and we are close to the clouds, we need to do way too many things to make it behave and look correct. Depth, upscale, high iteration levels... that's too much for vr. The VR showroom is an example of costly setup. IT IS ABSOLUTELY CRAZY :) It has:
    • 2 cloud layers
    • volume shadows
    • 2 realtime reflection probes for glass!!!!
    • stereo depth '-_-
    • edge aware upscale
    That setup is crazy for VR :)
    When we load the other scene we can see that it runs super smooth.
    2017-06-11_11-33-58.jpg
    I did what I recommended. FV is used here to render background clouds. This way we avoid the task of computing depth and perform depth-aware upscale and all of that sh**. Then, a uniform fog volume is used for the lower heights.
    2017-06-11_11-37-26.jpg
    I will refresh all the packages soon.

    btw, edge-aware upscale is not yet applied to the right eye. But honestly, I think that I have to try to do something better for that part. Im not happy with it; edges are still too jaggy.

    This time the problems described in slides 41 and 42 are gone :)
    Lets see it:
    2017-06-11_11-12-36.jpg
    2017-06-11_10-54-10.jpg
    Lets play now:
     
    bgrz likes this.
  5. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    54
    Thanks for such a detailed response! :) Definitely understandable that clouds colliding with environment would require too many resources for VR.

    I can't wait to test the new demo - from the screenshot, it looks great. :)

    A couple last questions: just to confirm, your height fog doesn't have any issues with VR, unlike the existing Unity global fog?

    And finally, is it possible to use cloud shadows with this setup?

    Thanks,
    Matt
     
  6. br90218

    br90218

    Joined:
    May 25, 2016
    Posts:
    4
    Help! I have a really serious issue regarding to ztest:
    upload_2017-6-12_12-49-37.png

    As you can see, the tracks and the towers are not being blocked by the clouds, but the player's model is...
    How can I fix this?
     
  7. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    Humm... Do you see the elbows? They are in front of the fog. Some objects are in front and some others behind, so I think that this has something to do with objects or materials.
    I would try in first instance to reset the renderer draw order with this script and check the material queue:
    2017-06-12_9-41-38.jpg

    Also, copy some of those meshes to the scene "Fast clouds" and check what happens.
     
  8. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    18
    I am currently having troubles with building my project with FogVolume. I have a single simple scene that builds in about 5 minutes without FogVolume enabled. However, when I enable FogVolume it has so far taken 3+ hours and showing no sign of stopping with UnityShaderCompiler maxing out all the cores on my CPU. I have already gone through FogVolume.shader and commented out over half of the shader_features as I wasn't using them. Is there anything else I can do to speed up build time with FogVolume?
     
  9. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    Seems like 3.1.9 is working 100% correct in vr.
    About features, everything remains the same; shadows work in vr too. Check the VR Showroom demo.
    2017-06-12_10-59-59.jpg
     
    matteumayo likes this.
  10. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    Humm, Im aware of the problem of having such amount of shader variants. When I modify the shader, it takes longer because the shader variants has to be compiled again.
    There are some things we can do:
    1. #pragma only_renderers your target
    2. Replace #pragma shader_feature and #pragma shader_feature with #define
     
  11. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    18
    How would I use 1? I'd place that pragma in the first Pass in FogVolume.shader with my "target" being Windows 64-bit? What's the syntax like for that?
    So for 2, I'd replace for example #pragma shader_feature _FOG_GRADIENT with #define _FOG_GRADIENT?

    I also forgot to ask, how do I get access the the Unity Store version? I was one of the first to buy Fog Volume 3 from your shop, but I forget to check back there to see if there's been an update, so it'd be easier for me if I could just check my assets directly in Unity.

    EDIT: I figured out how to only target my platform, it was just using #pragma only_renderers d3d11 for me
     
    Last edited: Jun 12, 2017
  12. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    18
    I tried this, and got really strange results.
    The first image is with #define instead of #pragma shader_feature, the other without, and how I expect it to look
    [​IMG]
    [​IMG]
     
  13. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    18
    Well, setting the #pragma only_renderers d3d11 and setting all single choice multi_compiles to #define (read in another thread that they are equivalent), and letting it build once for 30 minutes, I am now able to get builds out in 3-4 minutes. However, I still don't see my clouds in the build, that I can see in editor, so I am obviously missing something.
    I've set Hidden/FogVolume, Hidden/FogVolumeBloom, and Hidden/FogVolumeDensityFilter to be "Always Included" in my Graphics Settings. Is there anything else I'm missing?

    EDIT: I added the rest of the scripts form the FogVolume/Resources folder, but that didn't solve my problem either.
    I figured something was wrong with my set up, as it might be a special case. I'm working with VR, so I have my VR player controller with its centerEyeCamera, but I also want a third person view to render to the screen, I call this observerCamera. I set a Fog Volume Renderer on both of these cameras, hoping it would render to both. It does, but only in the editor.
    I tried removing my ObserverCamera, if it did anything weird with FogVolume. Now I can't see the clouds with my VR camera. I've traced it to the Culling Mask of my VR camera being set to NOT include "FogVolume" and "FogVolumeShadowCaster", AND setting "FogVolumeSurrogate" despite me not wanting this. Pausing and then setting them back I can see the clouds. Restarting resets the values to cull the clouds once more. How do I stop this behaviour?
     
    Last edited: Jun 12, 2017
  14. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    328
    I noticed that the Fog Volume ignores Unity gradient lighting. Is this by design? What benefits does this provide over the expected result of the Unity gradient horizon color affecting the clouds?
     
  15. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    It was not taken into account. FV uses its own settings
     
  16. StaffanEk

    StaffanEk

    Joined:
    Jul 13, 2012
    Posts:
    328
    Are there any benefits to that. A assume most users will be using Unity lighting when using the Unity editor.
     
  17. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    In that case, what should I do if ambient lighting is not based on a gradient? If ambient lighting comes from a cubemap? If ambient light is a color would the FV gradient be flat too? Thus ...advantages, independency and flexibility.
     
  18. BinaryLegend

    BinaryLegend

    Joined:
    Aug 10, 2015
    Posts:
    18
    Please David, what do I have to do to get clouds to render in a build? It works perfectly in the editor!
     
  19. RomBinDaHouse

    RomBinDaHouse

    Joined:
    Mar 18, 2015
    Posts:
    6
    Yeah, RenderSettings.ambientProbe for general case will be cool!
     
    StaffanEk likes this.
  20. adamz

    adamz

    Joined:
    Jul 18, 2007
    Posts:
    765
    Can this also be used for volumetric clouds that you can fly through? If so, is there any comparisons with TrueSky which is what I'm currently using?

    Thanks.
     
  21. Metron

    Metron

    Joined:
    Aug 24, 2009
    Posts:
    894
    Hi,

    small question: Has anyone tested this with GearVR?
     
  22. DavidMiranda

    DavidMiranda

    Joined:
    Nov 30, 2012
    Posts:
    440
    Have you played the demo? There are some scenes that may help you to compare.
    About TrueSky, nope, I don't have it.