Search Unity

  1. Check out the Unite LA keynote for updates on the Visual Effect Editor, the FPS Sample, ECS, Unity for Film and more! Watch it now!
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Assets [RELEASED - FREE] Aura - Volumetric Lighting

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

  1. XN4k3dBR

    XN4k3dBR

    Joined:
    Sep 15, 2015
    Posts:
    11
    When trying to compile for windows 10 UWP two errors occur:

    ERROR 01
    "Shader error in 'Hidden/Aura/ProcessOcclusionTextureShader': forced to unroll loop, but unrolling failed. at line 71 (on d3d11_9x)

    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_RGBM_ENCODING"

    ERROR 02
    "Shader error in 'Hidden/Aura/ProcessOcclusionTextureShader': can't use flow control on this profile at line 75 (on d3d11_9x)

    Compiling Fragment program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF3 SHADER_API_MOBILE UNITY_HARDWARE_TIER1 UNITY_COLORSPACE_GAMMA UNITY_LIGHTMAP_RGBM_ENCODING
    "
    Can you help me?
     
  2. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    59
    Thanks for your hints. I managed to get the other parties surface shader working with the final colour Fog applied... but couldn’t get the lighting to work since there seems to be issues with surface shaders recognising the usage of Texture2DArrays. As you say, surface shaders seem to have some limitations/issues!! At least applying the fog is good enough
     
  3. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Surface shaders are actually a bunch of weird macros generating uneatable book of code...

    You don't need Texture2DArray if you want to sample the lighting out of Aura, it is encoded in a Texture3D like the fog.
    Just use those lines:
    Code (CSharp):
    1. sampler3D Aura_VolumetricLightingTexture;
    2.  
    3. float4 Aura_SampleLightingTexture(float3 position)
    4. {
    5.     return tex3Dlod(Aura_VolumetricDataTexture, float4(position, 0));
    6. }
    7. float4 Aura_GetLightingValue(float3 screenSpacePosition)
    8. {
    9.     return Aura_SampleLightingTexture(float3(screenSpacePosition.xy, Aura_RescaleDepth(screenSpacePosition.z)));
    10. }
    11. void Aura_ApplyLighting(inout float3 colorToApply, float3 screenSpacePosition, float lightingFactor)
    12. {
    13.     float3 lightingValue = Aura_GetLightingValue(screenSpacePosition).xyz * lightingFactor;
    14.  
    15.     colorToApply = lightingValue;
    16. }
     
  4. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    I answered on the github ;)
     
  5. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    164
    Is single-pass VR support something that's still being looked into?

    Thanks.
     
  6. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    tbh VR is not something I actively look into, BUT I quite have understood what impeach single pass and it is actually really close to the one-camera only design issue, so one step at a time I think this will be achieved
     
    matteumayo likes this.
  7. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    59
    Good point! I had copied over the standard Aura functions which had the BlueNoise lookup that needed Texture2DArray. But without that it can be simplified as above.

    Edit: After testing the Aura lighting in the surface shader with your suggestions, the lighting seems to fix all pixels on the same colour ? Is this really the right approach to lighting for surface shaders which are using the "finalcolor" mechanism ? Something doesn't seem quite right...

    The fog however works perfectly with finalcolor - this on it's own looks good enough for me I think!
     
    Last edited: Jun 9, 2018
  8. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Lighting and "foggin" occur at different stages.

    If you want to use the lighting information out of Aura, you must use a custom lighting model : https://docs.unity3d.com/Manual/SL-SurfaceShaderLighting.html

    The fog must stay in the finalColor function as it happens after everything else.
     
  9. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    59
    Ahh, I see. Well that explains why I was having issues

    Custom lighting sounds complex, I’ll probably stay with just the fog
     
  10. Oderus_Urungus

    Oderus_Urungus

    Joined:
    Jun 8, 2017
    Posts:
    70
    I already have, and I'm currently using Aura in my game, but I'd like the Gaia extension. Do I have to redownload the entire Aura file from here?
     
  11. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    nah you can, from the github, just overwrite the AuraLight.cs, AuraVolume.cs and download the GaiaExtension.cs, it should do
     
    Oderus_Urungus likes this.
  12. RendCycle

    RendCycle

    Joined:
    Apr 24, 2016
    Posts:
    323
    Thanks for sharing this! I've managed to get it to work I think. But I get console errors in Unity 2018.1.

     
  13. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Those are not errors but warnings because they deprecated some APIs, don't worry about them, i'll consider changing them in the futur
     
    RendCycle likes this.
  14. idfr7771

    idfr7771

    Joined:
    Jun 23, 2018
    Posts:
    1
    Its not suport in android build ?
    I try to change to android build and acript cant enables
     
  15. Shyjay

    Shyjay

    Joined:
    Mar 29, 2016
    Posts:
    5
    Hey coming back at this thread again to check if your new version fixed the start deactivation of aura Lights and Volumes me and some others have encountered. I just wrote a script that reactivates them but would be better if it just wouldnt turn off on Project start ;). Maybe you already implemented and I just missed it.
     
  16. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Aura is not expected to work on Android.

    It requires a deeper fix but it's coming along ;)
     
  17. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201


    Realtime edition in SceneView is coming to
    Aura - Volumetric Lighting

     
    Last edited: Jun 25, 2018
  18. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    423
    OK, in theory, with the aura component working on the 'scene camera' is this part of a pathway to nice fast VR goodness?

    Also, how is performance in scene view? for us plebs that have scene AND game view side by side, presumably aura would be running on both.

    Also, it would come under effects, yes? in Scene view where you can toggle on/off things like fog, effects, lighting, etc.
     
  19. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    This is part of the improvement plan, which also contains the single pass wish somwhere in the end

    It currently mimics the settings from the main camera but I guess there might be different settings in the end, didn't work on that currently

    I cannot override that dropdown, this will probably be enabled with the postprocess checker
     
    Alverik likes this.
  20. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201


    Teaser of the WIP improved filtering technique.
    Same resolution, better quality.

    AuraNewFiltering.gif
     
  21. Korindian

    Korindian

    Joined:
    Jun 25, 2013
    Posts:
    386
    Really beautiful effect!

    I noticed in the Profiler for all the example scenes that Aura allocates about 0.5KB every frame on 2018.1.6. Is there anyway to reduce it so that there are zero allocations every frame?

    Thanks!
     
  22. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Thanks for the observation. It shouldn't happen, i'll track this memory leak down.
     
    Alverik and Korindian like this.
  23. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Very nice and peaceful tutorial video on how to get started with Aura by @lmhpoly. Follow him!

     
  24. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    492
    I am having some issues. Everything imported fine, no errors but the directional light example scene runs at 4fps and goes to 15 when I disable "enable volumes" in the setting. I don't think you intentionally exported a 4fps scene did you?
    Unity is using 2gb of my ram too in that example scene what's up?
     
  25. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Stats depend on your machine... It is a modern solution for modern hardware and rig.

    PS : don't be passive/aggressive if you wan't people to help you...
     
    Alverik likes this.
  26. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    492
    It is a free asset so I might be expecting a bit much but there was no mention of it being for designed for modern GPU's and I waited an hour for it to import to come into the directional demo scene which runs at 5fps.

    The other light demos run over 60fps so I was pretty sure it was a bug. Purchasing and running into bugs in Unity has made me passive aggressive over the years I can't help it lol. In one way I love the developers but on the other I want to strangle them lol.
     
    Alverik likes this.
  27. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    That's where you're wrong kiddo.

    Sorry, it was implicit that such volumetrics intrinsically take some performances. You'll understand why directional lights are more expensive when you're more experienced.
    On top of that, you still can lower the quality in the settings.

    PS : Your signature is inappropriate. I guess you are not as good as you think if you need your tools to work for you. Respect people if you want respect, even if you feel being treated bad (or is it just because you're a spoiled kid that want all for nothing). There is no lol, rofl or any lmao that will turn disrespect into jokes.
     
  28. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    492

    On the contrary my friend, passive aggression is probably the most obvious way to hint at someones experience. I won't fight you, just take these tips as you will.

    1.Looks at when this raphick made their account and realizes raphick has skipped the earlier development hell cycles of Unity 4 and 5.
    2.Realizes raphick hasn't figured out how to avoid the 1 hour shader compile time (Ask Megasplat creator, they did it).
    3.Realizes raphick can't take criticism and starts baseless, easily countered assumptions because they don't like the fact that deadlines and breaking tools don't mix. Again 2016 account.
    4.Realizes raphick is ignoring standard asset labeling and practices and assumes a lot.
    5.I have paid for better fog and lighting assets that all outperform yours. Just wanted to make that clear I am simply testing your asset and find it bad in comparison-your asset would not do well if it was paid for against Fog Volume and HX Volumetric for example as it stands their scenes perform much better at all stages and scale much better.

    But hey maybe I am wrong, maybe I don't know what I am talking about and am wrong about most of these posts....well I don't care, it's not like I am locked to this asset like I was back in the past during Unity's earlier days, thank god too.

    And on a final note when tools don't do their intended job and you have to fight with them, then you lose time and money and replace those tools with better tools.
    This is the real world and our users needs must be met or they will look elsewhere.
     
    Last edited: Jul 10, 2018
  29. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Should we enter a verbal joust? I guess it's not the place.

    The bottom line is :
    - It's not about criticisms (I got a lot), it's about the way you talk about/to developers. Respect is the key to everything, no-one cares if you're frustrated and cannot manage your anger except with sarcasms
    - Free is a gift to the community, if you don't like, you pass. It's like being angry because you wouldn't like the taste of a free apple
    - Shaders compilation is different than compute shaders compilation
    - Everything is explained in the description
    - Be my guess if you want to turn towards the future and give a chance to improvements, or move on and keep using your old unmaintained assets
    - I have had other accounts here, even so, this is not relevant of how experienced you are
    - I've been using Unity since 2011 (yes Unity 3 sir) and have developed more than 60 mid-size projects. I have been intensively involved in the PS4 port of Unity 4, way before it was even announced, before beta, before alpha. I have been involved in the development of middelwares for Unity PS4 that Sony has come to propose by default now.
    I know about development hell thanks.

    Now please can we just move on and focus on a positive mind? Feel free to stop polluting the thread and give up Aura if it doesn't suit you, or stay if you want to be constructive :)
     
    glenneroo, Alverik, khos and 2 others like this.
  30. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    492
    Calling Fog Volume and HX Volumetrics "old unmaintained assets", hypocrite much?
    You just won't stop will you lol. Again I am fine with my solutions, I am just testing yours and noticed it's so bad, it's asking too much and offering so little in comparison. The default example scene with HX Volumetric contains 2 spot lights and 1 directional light and it looks a lot better and runs at 40 fps while yours contains 1 directional light and runs at 5fps and is a resource hog.

    We're done here.
     
    Last edited: Jul 10, 2018
  31. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    636
    Seems like you know how to make friends..
    What hardware you running on, come on share the details then.. is a 2 core cpu, 2gig ram job?
     
    Last edited: Jul 10, 2018
    Alverik likes this.
  32. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    217
    Lack of experience maybe.

    https://www.psychologytoday.com/us/...ns-why-people-use-passive-aggressive-behavior

     
    Alverik likes this.
  33. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    @khos @ceebeee Thanks for your support.

    By the way : the big update a lot of people are waiting for is coming ;-)
     
    Jesus, Neviah, Alverik and 2 others like this.
  34. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    230
    vr support - hype !? :D
     
  35. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    I don't know if I'll have time but one thing for sure, multi camera support is a thing ;-)
     
  36. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201


    Upcoming biased depth distribution technique.
    Same resolution, much better quality.
    Stay tuned for update 1.1!

    AuraNewBiasedDepthDistribution.gif
     
  37. KenAlcapone

    KenAlcapone

    Joined:
    Oct 4, 2016
    Posts:
    6
    Please tell me, how to slow down the fog

     
  38. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    This is not a movement in the fog. This is the temporal reprojection jittering. Try playing with the reprojection factor in the settings in the camera. There should be more control in the next update.
     
  39. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201


    Improved stochastic jittering for temporal reprojection.
    Same resolution, better quality.
    MAJOR UPDATE 1.1 coming in August. Stay tuned!

    AuraImprovedReprojectionJittering.gif
     
  40. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    37
    Hi ,
    I had a search of these forums but couldn't see mention, has anyone come across a issue with Hydroform with Aura?
    https://assetstore.unity.com/packages/tools/particles-effects/hydroform-ocean-system-76960

    I uploaded some screen shots of the issue here https://imgur.com/a/ohEkFQU

    Basically if i disable aura Aura script on the main camera the problem goes away!

    As the screenshots show, if i increase the strength of the aura light the problem is more pronouced, lowering the strength starts to remove the artifact.

    I am using Unity 2018.2 in deferred rendering mode, Aura ambient density 0.01 ambient anisotropy 0. 1 directional light in scene with aura light.cs strength 0.5 (varies depending on time of day).

    Already asked Xix-Interactive on his forums https://forum.unity.com/threads/hydroform-ocean-renderer-released.385545/page-14
    he doesn't know why the issue would occur and suggested i ask you.
     
    Quique-Martinez likes this.
  41. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    201
    Hi!
    Aura can be applied in two ways :
    1. In a post process pass on all the opaque objects
    2. In custom shaders (for transparent objects)
    I guess the water is a transparent shader so its shader needs to be modified to take aura into account. See the "Custom Shaders" section of the Starting Guide.pdf to learn how to do so. ;-)
     
  42. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    37
    Thanks Raphick, i'll try that now (and sorry for not finding it in the manuel)
     
    raphick likes this.
  43. Sholms

    Sholms

    Joined:
    Nov 15, 2014
    Posts:
    15
    hello, I want to change the color of a aura volume randomly in run-time, is possible change the color of a aura volume in run time?
     
  44. d-3

    d-3

    Joined:
    Oct 18, 2009
    Posts:
    203
    Hello folks!!
    some one having this error to or is just me in unity 2018.2.of2?

    by the way F***ing Amazing job @raphick
    Thank you!!
     

    Attached Files:

  45. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    423
    Yes

    In the manual I think it mentions it, but basically at the start of your script, you need to have: "Using AuraAPI" or something at the top with the other "Using ABC" lines. It should auto-fill so you get it right.

    From there, you have a gameobject with the aura volume, and you use getcomponent to grab the volume component, this is just like anything else you do in Unity in a script. Once you have that, you can chance the volume colour as you want.
     
  46. Rog

    Rog

    Joined:
    Oct 16, 2012
    Posts:
    25
    With Unity 2018.2.0f2 I am getting this error, unless "Enable Shadows" on a directional light are turned off:

    Graphics.CopyTexture can only copy between same texture format groups (d3d11 base formats: src=27 dst=1)
    Thread is not attached to scripting runtime
     
  47. amarillosebas

    amarillosebas

    Joined:
    Feb 28, 2013
    Posts:
    17
    Is there a way to disable the frustum in the editor?
     
  48. MechaWolf99

    MechaWolf99

    Joined:
    Aug 22, 2017
    Posts:
    11
    I really love this, and thank you so much for making it free.

    I have been messing around with it for several hours. But having a bit of trouble. Is it possible to make something like shown in this image? First is actual in game, second is an artistic enhancement. But I am having a hard time reproducing the same sort of look with Aura. I'm not sure if it is really possible, and don't want to waste my time trying to make it, if it isn't.
    Do you think it is?
     

    Attached Files:

  49. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    163
    Those look more like distinct clumps of particles? If so you could just have some particle emitters here and there with lit particles?
     
  50. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    217
    That looks more like ground fog than volumetric effects. The thing about volumetric lighting is that it's primarily affected by light. The dark cave scene doesn't really have light shafts to define. Like Adam-Bailey says, it would probably be closer to what you want if you went with some particle systems to create a fog.