Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

[Released] Lux Lit Particles

Discussion in 'Assets and Asset Store' started by larsbertram1, Jan 27, 2019.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711


    Lux Lit Particles provide advanced particle shaders which add high quality yet performant real time lighting including normal mapping, wrapped around diffuse lighting, translucency and directional shadows in order to make your particles just fit your scene’s lighting.

    Lighting Features
    • Support for real time directional, spot and point lights (per pixel and/or per vertex).
    • Per pixel lighting and normal mapping for 1 or 4 lights.
    • If only one light uses per pixel lighting 3 additional lights will be shaded per vertex.
    • Particles may receive directional shadows (per vertex or per pixel).
    • Wrapped around diffuse and simple translucent lighting.
    • Ambient lighting: Skybox, gradient and color are supported (per vertex or per pixel).
    • Particles support Light Probes (per vertex or per pixel).
    • Particles may cast shadows (WIP).

    Particle Features
    • Lux Lit Particles have been written with classic view aligned billboards in mind. Other billboard modes like Horizontal Billboards or non view aligned billboards are only partly supported.
    • The provided shaders only support alpha blended particles.
    • Flipbook blending is supported.
    • Lux Lit Particles may use tessellation in order to enhance per vertex calculated lighting and shadows while still rendering at high speed.

    Compatibility
    Lux Lit Particles have been successfully tested on DX11, OpenGLCore and Metal (desktop). Mobile platforms neither have been tested nor are recommended. DX9 is not supported.

    Limitations

    To find out more about any limitations please refer to the docs.

    Asset Store / Documentation





     
    Last edited: Feb 2, 2019
  2. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    [Reserved]
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    Version 1.01 has been submitted.

    ### Fixed
    - Lux Lit Particles Tess Bumped shader: Missing emission feature added.
    - LuxParticles_AmbientLighting.cs: Ambient lighting is calculated OnEnable.

    ### Added
    - Per pixel ambient lighting support.
    - Light Probe support.
    - Dedicated albedo texture support.
     
    NeatWolf and hopeful like this.
  4. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    Version 1.01 is live.
     
    NeatWolf likes this.
  5. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    252
    I suppose your new particle shaders do not change the fact that large particles cause significant overdraw issues?

    I mean, how would they, but one can hope. It looks good either way. Might try it out.
     
  6. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    883
    Hi there!

    I'm really interested in purchasing and I'd love to make a few questions

    Could you please make a Lux vs native Unity lit particles (specific version/RP) comparison table?
    I must have got lost in the lit particles upgrades Unity did along the way :p

    I'm pretty sure your solution is either more performant or has a broader scope, but I can't visualize that at the moment
    (split Lux/Unity screenshots would be cool as well)

    This is not an attempt to deprecate your work, I'm just genuinely confessing my ignorance in this field here, as I haven't tinkered with lit particles enough :oops:
    My best guess is that Lux implements accurate per pixel lighting/shadowing, regardless of the rendering pipeline (or, using the default RP?).

    Is Lux NGSS2 compatible? Does it depend on native Unity shadow system?
    (I'm browsing through the docs right now, I missed the link above)

    Are there any plans to make it LWRP/VR compatible (single pass) or make it work with no dominant direct lighting (eg.: in a corridor of an alien spaceship, but in a point where the sun/direct lighting contribute isn't noticeable)?
     
    Last edited: Mar 27, 2019
  7. LosTChG

    LosTChG

    Joined:
    Apr 7, 2015
    Posts:
    6
    Hello!

    I was thinking about buying this. Does it work on 2018.3?

    Thank you in advance.
     
  8. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    i haven't tested it – but in case you use the "legacy" rendering pipeline it should work properly as it is more or less just a shader. some scripts are needed to provide ambient lighting and the main directional light but they are pretty basic.
    in case you come around any problems in 2018.3 – just let me know.
     
  9. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    sorry for my late reply – but i did not get any notification...

    lux lit particles are built for the standard or legacy render pipeline. i do not know much about lwrp or hdrp, so all i can say is related to the standard render pipeline.
    here "native unity lit particles" are either using the "lit particles" or the "standard particle shader".
    while the first one does all lighting in the vertex shader and supports spot lights, the latter uses per pixel lighting for 1 directional light only (as it uses "noforwardadd") and applies all other lights in the vertex shader. per vertex lighting here uses the standard surface shader lighting which does not support spot lights. spot lights here are treated as point lights.

    lux lit particles combines both. it is based on per vertex lighting thus it can shade up to 4 lights within a single pass including directional, point and spot lights. but it combines this approach with per pixel lighting and supports bump mapping.
    furthermore it supports sampling the shadow cascades of the main directional light so particles may receive real time shadows.
    last but not least tessellation is used to improve per vertex lighting and supports proper ambient lighting.

    lux lit particles rely on the shadow cascades to sample shadows – just like ngss does. i haven't looked into ngss2 but i hardly doubt that is renders its own cascades. it just replaces the screen space shadow sampling based on the provided cascades. so it should be fine
     
    Last edited: Apr 29, 2019
    NeatWolf likes this.
  10. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    883
    Thanks for the reply! :)

    This month I tested the asset pretty intensely and managed to get some awesome trail smoke with NGSS2 and Aura2.
    Aura2 messes up the rendering order, so the sunshafts appear -behind- the particles and a lot of other shaders. But that's an issue of Aura2 alone that I already reported several times to its creator.

    Apart from that, I'm utterly satisfied and just left my review :)

    One thing that I'm missing is fading particles out as they come closer to the camera (adding a fadeNearCameraBegin and fadeNearCameraEnd parameters). I could probably try tweaking the shaders myself, but all changes would be wiped out on the next update :)

    I wish I could have paid it more to boost the attention of the developer on it, burning down the whole roadmap! :)

     
    Last edited: Apr 29, 2019
  11. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    hmm, that should be already in?!
     
  12. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    883
    Yes, but I believe is 0 based. That is, begins fading from 0 distance.
    I was wondering if it would be possible to define a distance from the camera where the alpha is completely 0, and then it fades to 1 until it gets to the distance that's actually the very first value here (x):


    Basically I'd like to have thick particles as soon as possible but with no clipping (otherwise I'd just have increased the camera nearclip or tweaked the zOffset of the particle, but that's something I'd love to avoid).

    Basically you'd have an extra value to push on the left of the above interface:
    clipFadeBegin, nearFadeEnd(what currently is x), farFadeBegin(currently y), clipFadeEnd(currently what z is)

    No particle gets rendered before nearFadeBegin, saving a few calls.
    I could tweak the gradient of the particle system but it would be emitter speed-dependent.

    I know it's something very specific, so instead of having to tweak this every time the asset gets updated, I was hoping to have it natively in the shader :p
    (and would help my OCD to ignore that unused W :D )
     
  13. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    i may have a look into this.
     
    NeatWolf likes this.
  14. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    Version 1.02 is on its way and will bring near fade start.
     
    NeatWolf likes this.
  15. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Hello,

    Can Lux Lit Particles work with the new HD Render Pipeline? I am looking for particles that can use normal maps that can also work with the HD render pipeline.

    If not, is there any way you could work on making it work with the HDRP? Just wanted to ask. Thanks.
     
  16. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    no, they are written for legacy.
     
  17. Velo222

    Velo222

    Joined:
    Apr 29, 2012
    Posts:
    1,392
    Ok, thank you.
     
  18. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    i submitted version 1.03 which adds support for LWRP and Unity 2019.1 / Unity 2019.2.
     
    Rowlan likes this.
  19. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    version 1.03 is available.
     
  20. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,088
    Hey, I'm using this for snow particles (not falling snow, but kicked up from the character moving through deep snow), but there's too much difference between the particle brightness from different angles. See screenshots -- from above, and from the side -- I guess in the latter, the particles farther away are shadowing the particles closer? Might be great for other objects, but it's too much for snow. (I've enabled directional shadows but not any per-pixel toggles -- those are likely great for other materials but didn't improve these snow particles.)

    So I'm hoping that I can tweak the shader to reduce this range of brightness. Is that reasonably easy for a novice to adjust in the shader code? If so, could you point me to where to do it?

    thanks!
    Dave


    particles from above.png particles from side.png
     
  21. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    hey dave,
    the shaders use per vertex lighting. so if your particles are very large lighting will become inaccurate.
    so try to reduce their size.
     
  22. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,088
    Oops, my apologies -- this scene I was testing in didn't have the LuxParticles script assigned to the directional light. Adding that is a big help, of course!

    But that gets me back to what was actually my original question -- the particles are too dark in shadows compared to in sunlight -- which is probably accurate for a lot of substances, but seems too much for snow. It should still be pretty white even in shadow, not near-black. Is there anything I can tweak in the shader code to reduce that?
    picturemessage_u4ela0hb.lzn.png
     
  23. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    not sure - but you may try to add backside ambient lighting. so evaluate the sh ambient lighting twice.
     
  24. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,088
    ok...how do I do that?
     
  25. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    find the section in the shader taht deals with: // Per Pixel Ambient
    assuming that you use sh ambient lighting (from the skybox) oyu would simply add another lookup like so:

    // Per Pixel Ambient
    AlbedoOut.rgb += color.rgb * Lux_ShadeSH(float4(-normal, 1) ) * yourfancycustombacklightfactor;
     
  26. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    1,345
    Lux Lit Particles again to the rescue! :) My dust particles were bright as day at night. Not anymore :D

     
  27. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,088
    Thanks -- I tried that, but not seeing any effect. Quite possibly I'm doing something wrong though. I'd be happy to pay for a bit of consulting time to get it looking how I want it, via Skype....
     
  28. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    424
    Hi, do these work with URP?
     
  29. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    iddqd likes this.
  30. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    157
    Hi,
    I'm using Lux Particles and it's really good as it works.
    I've a question.
    I know that you write "Lux Lit Particles have been written with classic view aligned billboards in mind." but I'm achieving nice results using also mesh mode. I'm using mesh so I can create an octagonal mesh to cut away a bit of overdraw.
    The nice thinkg about mesh mode for particles is that you use the GPU instancing but this feature must be coupled with a shader that are compatible with instacing.
    So, my question is if it's possible to add an "Enable GPU instancing" button in the shader to be compatible with GPU instacing particles.
    What do you think? Is doable?
    Thanks in advance.
     
  31. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    it is doable, but you will have to add all the needed code manually. refer to the unity documentation on gpu instancing.
    nothing i can look into right now, sorry.
     
  32. marcatore

    marcatore

    Joined:
    May 22, 2015
    Posts:
    157
    OK.
    thank you for your reply.
    I'll try to understand how to do it...not sure to make it happens..but let see.
     
  33. Monil

    Monil

    Joined:
    Apr 24, 2012
    Posts:
    66
    Hi,

    Particles may cast shadows or is it still in development?
     
  34. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    5,711
    particles may cast shadow.
     
unityunity