Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Assets [Unity Awards 2018 - BEST ARTISTIC TOOL Winner] Aura - Volumetric Lighting

Discussion in 'Works In Progress - Archive' started by raphick, Nov 16, 2016.

  1. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    No i'm trying to add to my current project. I realise it must be something to do with this project but that is where I need it. I have managed to use it previously and im sure an empty scene would be fine too. I'll just have to work thorough and post any conflicts here to help others if I ever get to the bottom of it. Currently rebuilding from collab history because for whatever reason it has completely fubar my project.
     
  2. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    I came across no incompatibility so far but who knows...
    So far Aura has been succesfully tested on all versions from Unity 2017.2 to 2018.0.b12.

    But something tickles me... What exactly do you mean by "crash on import"?
     
    AndyNeoman likes this.
  3. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I mean Unity crashes when I try to import Aura from asset store. It seems to get stuck on compute.computeshaders (paraphrase) then unity crashes and shows bug report.
     
  4. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    It got stuck for like 30-40 min when i was importing it on this exact step but fortunately at the end got imported. It might be related to the computer resources. Try to close all other programs and processes if you had some thing opened previously !
     
    AndyNeoman likes this.
  5. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I've just noticed there is another vol light asset in my project with same shader name, maybe its that. I have closed all other progs to. Fingers crossed :).

    EDIT:- That did it! Strange behaviour for my rig. Now to the fun stuff of tweaking....
     
    Last edited: Mar 27, 2018
    Vagabond_ likes this.
  6. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Strange case you had my friend... strange... I never experienced such phenomenons in 6-7years of Unity... Different assets with same name should never make an issue (that's the GUID the important) and I find funny that another volumetric lighting solution uses the same name convention as me (which I intently make over-explicit).
    I suspect some lack of readme reading :rolleyes:

    Anyway! The most important is that it now works! Have fun!
     
    AndyNeoman likes this.
  7. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    Is that the same as EULA reading?
     
  8. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    No I meant the readme/starting guide/description/frontpage of Aura :p
     
    AndyNeoman likes this.
  9. smada-luap

    smada-luap

    Joined:
    Aug 22, 2013
    Posts:
    945
    You're expecting people to read installation instructions? :confused:o_O:eek::)
     
    AndyNeoman likes this.
  10. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    :D I expect them to act responsibly and stop wasting the other's time when they don't :p
     
  11. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I actually think it was related to windows regedit that I had done in the end. The named files were yours lol :). I didn't realises Aura installed to another folder other than Aura.

    The previous installed which had failed I only removed Aura folder. Anyway as you said, at least we are back up and running.

    Results look excellent and once I get a script changing settings depending on my weather system and time of day we will have a clear winner I am sure.

    Thanks for a great gift to the community.

    EDIT:- Actually I wanted to ask, how should light react to moisture in the air. I presume if it is wet then the volumetric light will be more pronounced, is that correct? My game is set in rainforest with lots of rain.
     
  12. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    In the docs it says something about the anisotropy being related to humidity in the air.
     
    AndyNeoman likes this.
  13. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Absolutely...

    also as it is said in the doc, there is no absolute truth here, it would be like asking "should the tree leaves be more green-yellow or more yellow-green?", the best is have several ideas of what you want and try.
     
    AndyNeoman likes this.
  14. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Yeah, my plan is to hook into the rain intensity and set the anisotropy from that. Also reduce the level a lot at night as for some reason it looks a lot more pronounced at 'night'. I did read the docs btw I was just asking for any tips :p
     
  15. KenAlcapone

    KenAlcapone

    Joined:
    Oct 4, 2016
    Posts:
    7
    I also have a noise problem! If you try to remove the fog / smoke via ( Ambient Light Strength -> 0 ) its very sad =(, I tried with 2017.3, 2017.4, 2018.1.0b8

     
  16. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365

    Doing this doesn't remove the fog, it sets the light factor to 0, then there is no volumetric light contribution.

    Changing Unity version will not change the core behaviour of Aura, or it would be a very very bad plugin :D
     
  17. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    not sure if this has been reported, but turning on shadows for a billboard particle will mage aura bug out and all shadow rays disappear. We are having the same issue with our water surface. Do you think that this is a bug that could be fixed within Aura itself?
     
  18. GusWarFire

    GusWarFire

    Joined:
    Jun 24, 2014
    Posts:
    2
    Hey guys, I've been having this problem in Unity 2017.2.0f3 with Aura since monday...

    I set up Aura like it says on the starting guide and everything works perfect on the editor, but as soon as I try to build a standalone "exe", it fails showing a bunch of errors related with Aura shaders and other unity errors.

    It only happens with aura because I've tried building without it and it works fine. I tried to reimport Aura several times and nothing, or if it does, the build crashes a few seconds after running.

    Any help would be appreciated ! :D

    EDIT: Updated Unity for version 2017.3.1f1 and the same problem occurs, but with less errors on the log.
     
    Last edited: Mar 31, 2018
  19. getCycle

    getCycle

    Joined:
    Mar 31, 2018
    Posts:
    1
    Hello

    for all people on a mac. I have tried this Plugin on 2017.4 and couldn't get it to work. (2017xxx had still the experimental Metal Api in Unity). I downloaded the beta 2018.1.0b13, where Metal is now standard, and with that it imports and works perfect!
    Didn't make any extensive testing yet, but import goes without errors and one can activate the scripts on the camera etc.) Made a simpel scene with a spotlight and saw the magic. Thanks @raphick for making such a great tool.
     
    Last edited: Mar 31, 2018
  20. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Speaking about the noise, I couldn't help but see a fellow creator (creator of NGSS) is working on a de-noise algorithm. Seems something like this would be the perfect companion to Aura.


    Maybe he can explain what he's doing.
     
  21. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi @raphick, what is the API to access the ambient density and ambient light strength on the camera component. Anyone welcome to chip in I know you can change everything at runtime but i'm having a problem finding them (long day).

    Edit Found them aura.frustrum.settings.x
     
    Last edited: Mar 31, 2018
  22. Jussukka

    Jussukka

    Joined:
    Feb 17, 2016
    Posts:
    25
    After digging around like crazy, I fount out that we had meshes on the UI layer that had shadow casting on, but were using a transparent texture. they were causing aura to freak out. After setting shadows to no on all of there, i managed to get everything working.
     
  23. jaz9186

    jaz9186

    Joined:
    Mar 17, 2018
    Posts:
    1
    Having similar issue, it gets stuck on computeshaders when importing, instead of Unity crashing my laptop overheated and shut down.
     
  24. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    This setting in regedit / cmd was the problem I had. Check that you have memory set high as possible and see if it helps. Follow these instructions and hopefully it should compile. Unity shadercompute chews through cpu cycles and memory for fun.

    https://steamcommunity.com/app/367520/discussions/0/135511455865797675/
     
  25. KeananMeier

    KeananMeier

    Joined:
    Apr 1, 2018
    Posts:
    1
    Has anyone had success getting this to work with multiple cameras? Works great with one but when enabled on more than one they get blacked out.

    Great asset by the way, thanks for your hard work!
     
  26. bonickhausen

    bonickhausen

    Joined:
    Jan 20, 2014
    Posts:
    115
    i cant build my game. unity cant unroll the shader loops.
     
  27. KenAlcapone

    KenAlcapone

    Joined:
    Oct 4, 2016
    Posts:
    7

    I will continue to use aura, I really appreciate that you support it for free and very grateful to you, only I am not found how to disable dithering in AuraUsage.cginc, maybe it's not there? https://pastebin.com/wWnKUh0v
     
  28. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Don't know if it's relevant to your project but I only get dithering at night in my scene. I have sun with aura light attached and moon without aura. plus the ambient which gives volumetric effect also. try increasing light overall or attaching aura to light as well as camera.
     
  29. AHFontaine

    AHFontaine

    Joined:
    Aug 3, 2017
    Posts:
    19
    Hi! I've looked in this thread for a similar issue but it doesn't seem to be the case. I tried importing and checking out Aura on a project that already has SSMS and the Unity Volumetric Lighting assets in the hierarchy, to compare performance and all. (2017.3.1)
    It seems that after the compilation process in the import (from the Assets Store), AuraUsage.cginc seems to be missing. Reloading the entire project doesn't show the scripts for Aura and the Volumetric scripts that I have disappear.
    I'll give it a try tonight on 2017.4 and on an empty project to see what's up but, in the meantime, I was wondering if anybody else hit that issue?
     
  30. foy

    foy

    Joined:
    Mar 28, 2013
    Posts:
    3
    Hello,

    Under Unity 2017.3 I can confirm that Aura does not function under Windows using OpenGL Core. I do see it functioning correctly without issue using DirectX11.

    The behavior under OpenGL Core is the same as if Aura was not present in the scene. I see no console errors being generated.
     
  31. rpopovici

    rpopovici

    Joined:
    Mar 30, 2018
    Posts:
    1
    Hi guys,
    If you are experiencing strange noise patterns when you are facing the light source, you can fix it by lowering near clipping plane's value on your main camera to 0.01. This worked for me..

    BTW: great solution @raphick
     
  32. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    I get a couple of errors whenever I first build my game on starting unity. Second build and onwards no such issue so it's not a biggie atm other than a little delay but id just thought I would in case there is a fix.

    This is windows build direct x 11 with unity 2017.4.0f1


    Shader error in 'Hidden/Aura/StorePointLightShadowMap': failed to open source file: '../Aura.cginc' at line 49 (on d3d11)
    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3 UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING

    Error building Player: Shader error in 'Hidden/Aura/StorePointLightShadowMap': failed to open source file: '../Aura.cginc' at line 49 (on d3d11)
    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3 UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_HARDWARE_TIER1 UNITY_LIGHTMAP_RGBM_ENCODING
     
  33. GordGames

    GordGames

    Joined:
    Nov 7, 2016
    Posts:
    32
    Hi there! Lovely looking so far, but I'm a total shader noob, is there any more instruction on how to mod a shader to support Aura? Specifically I need to change the nature tree shader that's in unity to get the volume light (see picture).
     

    Attached Files:

  34. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    Hey diddely ho neighbor!

    I just downloaded and imported into a project and let it do its long compile (2017.4). I of course spent a long day reading all of the documentation (just kidding, I am doing the same thing all these other cats are doing and jumping right in). Super dee duper to see it finish the compile. I loaded up a scene from a DLNK asset (Stronghold Village - https://assetstore.unity.com/packages/3d/environments/fantasy/stronghold-village-19612) to start fiddling around and had compile errors. "Assets/Aura/Examples/Sponza/Scripts/FreeCamera.cs(3,14): error CS0101: The namespace `global::' already contains a definition for `FreeCamera'".

    Anyhoo, the issue is related to the FreeCamera.cs sample:

    https://github.com/raphael-ernaelst...ts/Aura/Examples/Sponza/Scripts/FreeCamera.cs

    Just a suggestion, but maybe you might want to wrap those examples in a namespace because those are some pretty generic names to let loose in the global namespace. Just a heads up, and thanks for the cool asset.
     
  35. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    or maybe Stronghold village should put theirs in a namespace...
     
    ScourgeGames likes this.
  36. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    I think both. Or we could have a three legged-race on the fourth Tuesday of May to determine who should do it.
     
    ceebeee likes this.
  37. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Everyone should use namespace ... right? :)
     
  38. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    I'm pretty sure that's a good practice. I can understand people who don't bother when they put together examples and such. Then again, this is a cool free asset, and I'm not about to lose sleep over it.
     
  39. GordGames

    GordGames

    Joined:
    Nov 7, 2016
    Posts:
    32
    Fixed tree billboarding, for anyone interested, you needed to download the built in shaders, specifically edit Hidden/TerrainEngine/BillboardTree to add in the fog.

    Here's mine:

    Code (CSharp):
    1. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
    2.  
    3. Shader "Hidden/TerrainEngine/BillboardTree" {
    4.     Properties {
    5.         _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
    6.     }
    7.  
    8.     SubShader {
    9.         Tags { "Queue" = "Transparent-100" "IgnoreProjector"="True" "RenderType"="TreeBillboard" }
    10.  
    11.         Pass {
    12.             ColorMask rgb
    13.             Blend SrcAlpha OneMinusSrcAlpha
    14.             ZWrite Off Cull Off
    15.  
    16.             CGPROGRAM
    17.             #pragma vertex vert
    18.             #pragma fragment frag
    19.             #pragma multi_compile_fog
    20.             #include "UnityCG.cginc"
    21.             #include "TerrainEngine.cginc"
    22.             //For Aura
    23.             #include "../Aura/Shaders/Aura.cginc"
    24.  
    25.             struct v2f {
    26.                 float4 pos : SV_POSITION;
    27.                 fixed4 color : COLOR0;
    28.                 float2 uv : TEXCOORD0;
    29.                 UNITY_FOG_COORDS(1)
    30.                 UNITY_VERTEX_OUTPUT_STEREO
    31.                 float3 frustrumSpacePosition : TEXCOORD2;
    32.             };
    33.  
    34.             v2f vert (appdata_tree_billboard v) {
    35.                 v2f o;
    36.                 UNITY_SETUP_INSTANCE_ID(v);
    37.                 UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
    38.                 TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y);
    39.                 o.pos = UnityObjectToClipPos(v.vertex);
    40.                 o.uv.x = v.texcoord.x;
    41.                 o.uv.y = v.texcoord.y > 0;
    42.                 o.color = v.color;
    43.                 UNITY_TRANSFER_FOG(o,o.pos);
    44.                 //For Aura
    45.                 o.frustrumSpacePosition = Aura_GetFrustumSpaceCoordinates(v.vertex);
    46.                 return o;
    47.             }
    48.  
    49.             sampler2D _MainTex;
    50.             fixed4 frag(v2f input) : SV_Target
    51.             {
    52.                 fixed4 col = tex2D( _MainTex, input.uv);
    53.                 col.rgb *= input.color.rgb;
    54.                 clip(col.a);
    55.                 UNITY_APPLY_FOG(input.fogCoord, col);
    56.                 //Aura
    57.                 Aura_ApplyFog(col, input.frustrumSpacePosition);
    58.                 return col;
    59.             }
    60.             ENDCG
    61.         }
    62.     }
    63.  
    64.     Fallback Off
    65. }
     

    Attached Files:

  40. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    April's fool right? Bad guy! naughty! :)

    There are bunches of denoising algorithms but it's not the point here. I propose a dithering to lower banding, I think it should be to the user to use the technique he wants if it gives too much artifact.

    Add 0;// in front of each GetBlueNoise ;)
    BTW : I'll add a enable/disable dithering in the next version.

    Aura currently does not work with multiple cameras. My pleasure :)

    Thank you for confirming that, as expected, it doesn't work under OpenGl. I think the gap should not be big though.

    Have you updated to the latest version that fixes this? (https://github.com/raphael-ernaelsten/Aura/commit/bc2dbf5376fd7e0f4bd35ad3c857d0e525daf8f7)

    Actually I first had put it in the AuraAPI namespace but removed it because I finally didn't want to appear that I did it although I just used it from Unity's. I'll put it back in the next update to avoid conflicts.

    Awesome example of overriding a builtin shader for using Aura. Thank you for digging for it and sharing the solution!
    I'll include it in the next update.
     
    AndyNeoman likes this.
  41. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    I'm really enjoying the excellent work you've done here. It is relatively easy to set up, and it seems to perform quite well. Two things:

    1. Outcast - Second Contact is absolutely brilliant. Great job! The graphics are stunning and it brings back fond memories of the original game. I love sci-fi adventure games, and this is one I can play with my youngest son. I'd love to learn more about the development.
    2. Can anyone explain to me "out-of-phase" color concept and how I can properly determine the color to choose?

    Thanks!
     
  42. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Thank you very much. For as much as I am allowed to say, feel free to ask.

    It is linked to the anisotropy, which concentrate more the volumetric lighting around the light source (because light is more scattered).
    Instead of having the volumetric lighting "fade out" when it is getting away from the light source, the out-of-phase option allows to interpolate towards another color.
    So you'll have:
    • Out-Of-Phase disabled : Light (or overriden) Color --------Getting away from the source------>Void
    • Out-Of-Phase enabled : Light (or overriden) Color --------Getting away from the source------>Out-Of-Phase Color
    It has no physical coherence but allows to sustain the volumetric contribution when we run out of the anisotropy (or out of the scaterring phase function). Plus, it allows to create very cool variations of colors.
     
    AndyNeoman likes this.
  43. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239

    Thank you, that is very helpful. Might I suggest you add that to your documentation when you do an update in the future? That would be very helpful to future users. I'm really enjoying the asset and I think it will make a great addition to two of the games I'm working on. I hope to post some screen shots in the near future.
     
    raphick likes this.
  44. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    143
    I get NullReferenceException error whenever I add directional or point Aura light to the scene. Latest version, Unity 2017.4.
    NullReferenceException
    UnityEngine.Material..ctor (UnityEngine.Shader shader) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/ShaderBindings.gen.cs:254)
    AuraAPI.AuraLight.Initialize () (at Assets/Code assets/Aura/Classes/AuraLight.cs:399)
    AuraAPI.AuraLight.OnEnable () (at Assets/Code assets/Aura/Classes/AuraLight.cs:224)
    UnityEngine.GameObject:AddComponent()
    AuraAPI.AuraLight:CreateGameObject(MenuCommand, String, LightType) (at Assets/Code assets/Aura/Classes/AuraLight.cs:734)
    AuraAPI.AuraLight:CreateDirectionalGameObject(MenuCommand) (at Assets/Code assets/Aura/Classes/AuraLight.cs:744)
    UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
     
  45. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    this is a bug I already have reported. This happens sometimes when adding the component and never after. It doesn't prevent Aura from working though.
     
  46. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    143
    I also get NullReferenceException error in Cloud Build so I thought it might be connected. Does anyone use Cloud Build with Aura?
     
  47. I_Cudlitz

    I_Cudlitz

    Joined:
    Oct 22, 2016
    Posts:
    85
    This is really awesome, but there is one biggish issue for me- If baked lights get the Aura Light component added to them, it results in the console getting spammed with
    "Graphics.CopyTexture could not find source D3D11 texture object. Maybe it is a RenderTexture that is not created yet?"
    (with no stacktrace, sorry :x I wish I could give you one), and the volumetric effect does not work. Something interesting is that the sky gets slowly darker and darker while in play mode with this issue happening. Also, although it doesn't work in play mode, it does seem to sometimes work while looking at the game tab in edit mode.
     
  48. I_Cudlitz

    I_Cudlitz

    Joined:
    Oct 22, 2016
    Posts:
    85
    Oh, also, second minor bug report; For some reason, all aura components in the scene get disabled intermittently, not including the main Aura component.

    Also, forgot to mention; these bugs are being produced in the 2018 beta. I'd crack open other versions to see if they happen there as well, but I reeeally don't want to have to compile that compute shader again :U
     
  49. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    70
    Probably not going to happen, as Aura doesn't sample lightmaps, but only the realtime shadow maps. I don't know whether it's even possible to have it sample the lightmaps or not.
     
  50. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    Would it be possible with some sort of mixed lighting?

    If all the light does is absolutely static, then there's no dynamically generated shadow for Aura to steal. Perhaps in one of the lightmapping modes, where the light is still 'active' in some ways and does generate a shadow map, that might work.

    Another thing, is that I remember hearing somewhere that lights don't update their shadow mask if nothing is in them sometimes. This might be related to that; if the light is mixed and thinks there's nothing to shadow, then you could try putting an empty sphere collider (no mesh component even) somewhere in the light's frustrum, which would trigger the shadow pass as something is 'inside it'.