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. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    Actually, @raphick here's an idea I've been thinking of:

    I've got a way to handle this via script, and it's kinda ghetto, but I was wondering if you had something like this planned for any future release. This would be a way to fake multiple scatterings through a volume, sorta. It might work for the lit fog, but obviously not for the shadows.

    EDIT: >9000 hours in MS Paint
    anisotropy.png
     
  2. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    I am sorry I don't use cloud builds. Until someone tracks this down, I cannot think of what's wrong.

    This already came up. Answer is here :
    Because of this, if you want to bake the light and have Aura work, you'll have to set your lights to Mixed mode.

    I haven't currently found any straightforward solution, same for probes.

    Already came up too. The Aura Main Component STRICTLY has to exist before the Lights/Volumes. Will be changed in the next update.

    I have no plan of such thing as injection volumes allow to spatially modify the scattering. However, I've been looking to some absorbtion/extinction solution.
     
  3. erenaydin

    erenaydin

    Joined:
    Mar 1, 2011
    Posts:
    384
    It's a perfect product.
    Is there a way to see the effects in the scene mode?
     
  4. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Thx! Currently not as it requires to have multiple instances of Aura Main Component co-existing.
     
  5. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    239
    I'm always impressed when people can do great things with MS Paint. :D
     
  6. Shyjay

    Shyjay

    Joined:
    Mar 29, 2016
    Posts:
    6
    Hi Raphick,

    Thanks a lot for this nice package, was looking for something like this for my Diploma Project. I just installed unity 2018 and it also works great with that, just need to recompile the big computedata. When I recompiled it in Unity 2018 though on Startup I get this:

    Shader error in 'Hidden/Aura/StorePointLightShadowMap': failed to open source file: '../Aura.cginc' at line 49 (on d3d11)

    which causes all Aura Scripts to be disabled. Is it something in the Project Graphics/Quality Settings that needs to be changed for this error to dissappear?

    Keep doing things like this and I hope Unity takes you on board, they need people with your skill and attitude.

    Cheers
     
    Last edited: May 2, 2018
  7. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    AndyNeoman likes this.
  8. Shyjay

    Shyjay

    Joined:
    Mar 29, 2016
    Posts:
    6
    Thanks for the fast reply

    I have your newest Version so this could not be the Problem. After some searching I found the VolumetricLight.shader Position in my folder hierarchy to be the Problem. Unity put it into my own Shader folder outside of the Aura folder so it could not actually find the aura.cginc.

    Just in case anyone else has the same problem.
     
    AndyNeoman, erenaydin and raphick like this.
  9. kepesh

    kepesh

    Joined:
    Dec 29, 2017
    Posts:
    92
    Has anyone tried making shaders to work with either shader forge or amplify? I'm looking at the three steps but have no idea how to implement that.

    Also, is there a fix for the UI when it looks like this?
     

    Attached Files:

  10. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    I am currently in touch with Amplify to make Aura available out-of-hand in Amplify Shader Editor. No ETA
    There is no fix as this is not a bug. I take the editor UI skin as base for Aura but it happens that the pro(my real base) and free version's skins are too different. So no bug but room for improvement surely.
     
    kepesh and Neviah like this.
  11. mm1982

    mm1982

    Joined:
    Apr 28, 2015
    Posts:
    35
    Hi,

    can anyone speak to how Aura compares to the Hx Volumetric Lighting package in terms of performance?
     
  12. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    It's difficult to compare things that vaguely so the same but have a totally different output quality.
     
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Well ... how does the output quality differ? :)
     
  14. Oderus_Urungus

    Oderus_Urungus

    Joined:
    Jun 8, 2017
    Posts:
    96
    I was watching the village demo scene posted, and saw raphick use a haze script. I have Aura up and running in my project along with SSMS Global fog, and it looks damn good. I'd like to use that haze script as well, but it doesn't seem to exist in my download. Any suggestions?
     
  15. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Haze was the development name of Aura ;-)
     
    Oderus_Urungus likes this.
  16. XOA_Productions

    XOA_Productions

    Joined:
    Nov 27, 2016
    Posts:
    24
    Hey there!

    I've noticed a issue using unity 2018.2.0b3 (everything else works perfectly). When one enters playmode with an Aura Light attached to a directional light and shadows enabled on the aura light component, this error pops up every frame:

    Code (CSharp):
    1. Graphics.CopyTexture can only copy between same texture format groups (d3d11 base formats: src=27 dst=1)
    2.  
    This is caused by the Texture2DArrayComposer (or one of it's child classes). If one disables and reenables the aura light component, the error logs will stop and the rendering of the light rays will work again. I wasn't successfull in finding out what causes this error, so hopefully someone here will have a clue.

    Regards,
    -Ben

    Edit: It seems as if removing the
    [ExecuteInEditMode]
    attribute from the AuraLight class solves the problem, although this obviously leads to the AuraLight not being displayed in editmode. Maybe that's a good starting point for someone who is a bit more familliar with the code than me to fix the issue, though.
    Other than that, I'm loving this asset very much:
    index.jpg
     
    Last edited: May 10, 2018
    Jesus likes this.
  17. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    @XOA_Productions that's a very nice looking scene. I've been having trouble getting aura to do what I imagine and have been wondering if perhaps it's not exactly designed for what I'm looking for (but your pic makes me think it is). Ii have a directional light poining down. I put a hole in my room's roof, a pretty small one. I'd love to see a shaft of light coming through but it's hard to get one to be clear.

    Could you share the settings you used?

    Also curious to understand what different characteristics aura has compared with hx volumetric lighting if anyone has used both?
     
  18. XOA_Productions

    XOA_Productions

    Joined:
    Nov 27, 2016
    Posts:
    24
    Sure, I currently use these settings (on 2018.2 beta):

    Unbenannt.PNG Unbenannt2.PNG Unbenannt3.PNG Unbenannt4.PNG Unbenannt5.PNG

    Images 4 & 5 are from the Postprocessing Stack V2.
    I feel like the most important settings are the intensity on the aura light and the settings on the aura main component. Playing around with the reprojection factor helped get the light shafts to be clear and remove some unwanted "movement" from them. Also the ambient light strength quickly gets too strong and kind of makes the light shafts less visible. Should work really well for holes in the roof I think.
    Using some form of antialiasing on the new postprocessing stack was really importent to help with the grain in the lightshafts aswell.

    Unfortunately I haven't used the other asset, so I cant comment on that.


    Regards
    -Ben
     
    ryschawy likes this.
  19. XOA_Productions

    XOA_Productions

    Joined:
    Nov 27, 2016
    Posts:
    24
    (Can't upload the additional picture to the post before - sorry)

    Those settings should produce what you're looking for:
    Unbenannt6.PNG
     
  20. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    Thank you very much for sharing! I will give this a try just as soon as I get to my computer tonight. I didn't try playing with the reprojection at all! I'll let you know how it turns out!
     
  21. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
  22. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    I managed to get light shafts coming down that are quite clear now, so thanks heaps for that. I noticed that thing that made a big different was the directional light's own shadow strength. When set to 1, the contrast is quite clear. I have my shadow strength at 0.7, and it makes the aura contrast quite difficult to notice.

    @raphick I'd like to ask if there is a way to have aura behave as if the direction light's shadow strength were set to 1 while I actually leave it at 0.7. I tried making a change to one of the shaders but then saw that each change would cost me a 20-30 min recompilation time so I gave up on self tweaking.

    Another thing I'd like to ask is if it's possible to 'cap' the light added by aura in large open scenes so that I can achieve strong light shaft indoors, while not having overwhelming lighting outside. I see that there is a 'distance' that is defaulted to 50, but ideally i'd like this quite large, but not allowing too much light to accumulate over a long distance outdoors.

    I'd like to tinker with the shaders myself a bit to achieve some of these things, but I'm unsure how to turn off the shader variants thing to get quick compilation times for rapid iteration. Any advice there as well?

    I'm super keen to get things just right because it really does lift the visuals of my game in those indoor areas!
     
  23. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    502
    Hello all.

    I've done a little bit of investigation and found out how to prevent the light 'haze' bleeding through walls and preventing a high contrast with light shafts.

    It's as simple as commenting out one this line in StoreShadowDataSharder.shader:
    Code (CSharp):
    1. outColor += CORRECT_IF_INFINITY(_LightShadowData) * GetMask(borders, stepSize, i.uv.x);
    Before:
    Before.jpg

    After:
    After.jpg

    Fortunately, this did not involve the compute shader so I could try a bunch of things till I found it :).

    Still unsure if it's possible to 'cap' the effect of large volumes of light outdoors so that I can still get nice light shafts using the 'out of phase' values. At the moment I have out of phase active and set to 0.
     
    Mauri likes this.
  24. Shyjay

    Shyjay

    Joined:
    Mar 29, 2016
    Posts:
    6
    Even though my former post helped to clear my problem with the Aura.cginc still every Time the Lighting is clustering all aura Components except for the Main Component get disabled. Its happening in Unity 2018.1.0f2 If I reactivate them everythings back to normal, but its quite annoying to do it every Startup so I would be glad if someone had a solution to this problem (No warning or Error about this in the Console).
    Just the "Lighting disabled in at least one Scene View" if I click on a light with that had been disabled
     
  25. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    yeah I get that often as well.

    It's something to do with requiring the Aura Main component on a camera, and it happens to me on save or script re-importing. If it reloads the scene and gets to a light before the camera/component, it disables the light / volume until it loads the camera, then it loads any further aura components fine.

    I have a script that executes in edit mode, that turns all the aura components on every frame. kinda ghetto, but saves me hunting for 6 lights and a volume.
     
  26. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    this will be fixed in next update (no eta)
     
  27. Shyjay

    Shyjay

    Joined:
    Mar 29, 2016
    Posts:
    6
    Thx for the Reply. Than I will check this Thread now and then to see if theres a new update
     
  28. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    I've imported it in the Unity 2017.4 with 11 red errors.

    Assets/Aura/Classes/SpotLightsManager.cs(47,26): error CS0246: The type or namespace name `ObjectsCuller' could not be found. Are you missing an assembly reference?
     
    Last edited: May 18, 2018
  29. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Sorry about that. Works for every one else.

    Make sure you have the whole Aura folder imported in its individual folder.
     
    AdamGoodrich and ksam2 like this.
  30. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079
    Thank you. I'll reimport again, the problem I had with Hx volumetric asset was that I couldn't get enough volumetric lights through windows inside buildings without ruining outdoor lighting. I hope get better resualt with Aura.


    Edited: Ok after testing this asset it seems I can't use it because it seem if you need volumetric light inside buildings you have to make outdoor area totally white :confused:
     
    Last edited: May 18, 2018
  31. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    Both assets are exhibiting behavior that's pretty much expected. When you are inside, why do you necessarily care what the lighting looks like outside? you can't really see it.

    Most games handle this one of two ways:
    • Interior scenes are separate from exterior scenes, and have lighting setups specific to the scene (think Skyrim).
    • When entering an interior, the lighting changes to adapt to the settings for indoors, when exiting, they adapt back to the settings for outdoors. (this is called eye adaptation).
    This is simply a feature you need to write for your game, whichever route you choose. It's not really a problem with Aura or Hx. Neither is going to have universally perfect light in every possible situation, without altering settings based on the situation.
     
  32. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Hmm, still no news about cascaded rendering?
     
  33. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    ... and the reason a room has more god rays than the outside is that the room supposedly has more ambient dust (density) than the open air...
     
    ceebeee likes this.
  34. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    not in the immediate weeks (in comparison, the official solution of unity will NOT have cascaded)
     
  35. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    since i finally did start to work with aura i did my donation yesterday :) i am really suprised that it works out of the box with vr. even performance seems to be quit good (ill have to investigate a little more). anyway i do use NGSS as well and "
    NGSS internally uses _LightShadowData to tweak the penumbra
    size of shadows which correspond to the Shadow Strength value of Unity built-in lights. Where do you access it so that i can disable the strength influence for aura?! i also have a black line where i render against the skybox but ill come back to that later.
     
  36. nbac

    nbac

    Joined:
    Jul 7, 2015
    Posts:
    267
    no i was to fast noise is not in worldspace in VR its moving with the viewDir and Pos else its pretty nice so a fix for that would be super cool
     
  37. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Sorry, but the volumetric lighting in HDRP actually IS cascaded. There's an option to control the distribution of slices so you can reduce the amount of them in the distance. There's still no way to control the quality, but now at least it's very possible to have volumetric lighting both in front of the camera at high quality and in the distance without a performance hit.
     
    Last edited: May 25, 2018
    elbows likes this.
  38. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    If by quality you mean the resolution used by the volumetric system, there is an Ultra mode which can be enabled by editing a couple of files, see this post and some of the subsequent discussion: #26
     
  39. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Thanks for that!
    Have a look here for storing the value :
    https://github.com/raphael-ernaelst...ers/Shaders/StoreShadowDataShader.shader#L109
    and here for using it :
    https://github.com/raphael-ernaelst...Includes/DirectionalLightInjection.cginc#L122

    I advise you to change the _LightShadowData.x to 0 in the StoreShadowDataShader.shader so you won't have to reimport the compute shader.

    Logarithmic distribution is not a cascaded system. I intend to have both.

    This is accessible with no hassle by default in Aura
     
    ryschawy and Kolyasisan like this.
  40. Yuki-Taiyo

    Yuki-Taiyo

    Joined:
    Jun 7, 2016
    Posts:
    72
    Hi,

    I just discovered Aura today.
    I did a test with it and I'm quite impressed !
    The scenes look fuller, less flat / 3Dish and it doesn't seem to eat ressources at all with a 256x256 grid and 128 depth.
    I'm eager to test it in interior scenes and see if it can be an alternative to realtime Global illumination, also faking shadows with Aura Volumes instead of Ambient Occlusion.
    I just wished the noise could be blured on sun shafts, it's too visible and I see no parameter to change this. The directional light (sun of procedural skybox) seem to pass through walls sometimes (I use Uber shader with tesselation materials), and I just have some conflict with Aura Volumes and another asset, Realistic Water : this water overlaps the volumes with maximum depth color (one fog overlaps another fog).

    Otherwise I can't wait to dig into this great lighting system that really fills of light.
    I'll make a donation sometime for sure.
     
    Last edited: May 31, 2018
  41. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Hi, why does Aura not work on 2017.1.0f3 , only 2017.2 onwards? :)
     
  42. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Why doesn't Unity ship with this by default? :)
     
  43. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    I think it's something to do with shader keywords; they changed a few internal names around for Unity's lighting calculations in the 2017 cycle.
     
  44. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Thanks!
    You can use the temporal anit alisaing in the PostProcessing Stack
    Something needs to be figured out with the bias
    You must modify their shaders so they use Aura

    Almost :p Mainly because of the multithreaded compute shader compiler. It is indeed needed for all the variants.

    You want the polite answer or not? :p
     
  45. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    I added an extension for Gaia (Procedural Terrain Generator)
    that allows to setup several types of environment in a single click.


    Get it on the GitHub : https://github.com/raphael-ernaelsten/Aura
    Asset Store version will be coming.
     
    Last edited: Jun 1, 2018
  46. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    1,476
    Cool Thanks for your answers :)
     
  47. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Hi Raphael,
    I'm getting some non expected behavior when using multiple cameras with Aura. Actually, it seems that having multiple cameras breaks completely Aura rendering. I can only guess that this happens because Aura doesn't allocate dynamically new RT's on per camera basis. Is there a way around?
     
  48. FrozenEmpire

    FrozenEmpire

    Joined:
    Sep 10, 2016
    Posts:
    96
    Hey! Awesome volumetric lighting implementation - congratulations on your achievement.

    I'm exploring compatibility with other assets and have to make some shader modifications in said other assets so that they can apply the Aura effect (yes I read the manual!).... however the example in the manual seems to be tailored for traditional vertex/fragment shader... and I have to mod a surface shader which doesn't have any custom vertex processing at the moment ie only the surface function is coded in the shader.

    Now I noticed that you have a surface shader in your collection which gives me a few hints how to apply Aura to a surface shader, ie apply fog via a finalColor shader mechanism... however that seemed to involve hardcoding all of the relevant functions instead of including the Aura.cginc include file. And it didn't cover the ApplyLighting case.

    So my question is, is that the only/best example of adding Aura to a surface shader ? Or do you have other examples that include ApplyLighting and might give alternative ways to integrate eg via the vert / surf functions ?

    Thanks again!
     
  49. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    501
    Are you using multiple cameras with their own Aura components? I don't think it's meant to be used on more than one camera (only one Aura main Component active).
     
  50. raphick

    raphick

    Joined:
    Nov 15, 2016
    Posts:
    365
    Hi this has nothing to do with render target allocation, but rather with components registration and culling. As Jesus said currently only one main component is allowed. This will be fixed during this summer.

    So that's you! :p
    Unfortunately, Surface shaders complier bugs when including a file that itself includes other files. So for now, I just wanted to illustrate how it could be achieve. Maybe there will be a more elegant solution one day. :confused:
    The way surface shaders work makes that is has to go through the FinalColor function to access the pixel at the very last stage.