Search Unity

UPGEN Lighting (Standard, HDRP, URP)

Discussion in 'Assets and Asset Store' started by mm_ASH, May 26, 2020.

  1. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    UPGEN Lighting is using Z-Buffer to calculate world position of each point on screen. If something renders on top of image (like forward geometry) it does not receive lighting. E.g. it will affect opaque and cutout geometry and will not affect transparent or fade materials. That's why it is excpected behaviour that Fog Volume does not receive lighting.
     
  2. Game_DevKH

    Game_DevKH

    Joined:
    Jun 11, 2017
    Posts:
    23
    I guess that it cannot be fixed, but as long as fast light still works. That's okay!!
     
    mm_ASH likes this.
  3. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    That depends on your lighting requirements - if you have day-night cycle, than only option is directional light with ray-traced GI. If directional light is not moving - you can just put hundred fast lights.
     
    NeatWolf likes this.
  4. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Here is an expample how we setup similar scale scene in our game:
    2020-07-12_174258.png
     
    NeatWolf likes this.
  5. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    But in this case directional light is not moving.

    2020-07-12_175513.png 2020-07-12_174646.png
     
  6. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Thanks!

    I believe lights are not going to move during gameplay - maybe right at the start when the hour of the day gets set.

    Is there any possible optimization with an (almost) static directional light? (eg.: caching or progressive refinement?)

    I'm assuming UPGEN works right out of the box with terrain, splatmaps, and trees?
     
  7. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    please urp :(
     
    mm_ASH likes this.
  8. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    As crazy idea: even if you have 24 hours cycle - you can have 24 groups of Fast Lights and just switch/instantiate those groups when time is changed (using script you can even cross-fade groups of Fast Lights)

    >Is there any possible optimization with an (almost) static directional light?
    Just put lights manualy or extract them from ray-tracing component (there is a button).
    Having set of Fast Lights is a kind of optimization in comparison to the Ray-Traced component, which calculates rays also in runtime.

    As for terrains - it will use terrain collider but not use splatmaps (for performace reasons) all auto bounces will be considered as reflection from white surface. But in design time (as far as you will do just Fast Lights for optimization) you can fine-tume manually colors of that lights.
     
    Last edited: Jul 12, 2020
    LostPanda and NeatWolf like this.
  9. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Thanks!

    I actually only have max 2 different daytime hours for each scene, and considering that the art/design departments could be possibly constantly moving stuff around, I was hoping in a semi-automated mode.

    Having 2 different sets seems a very good approach :)

    Probably everything is going to make more sense after I purchase it - after that I should ask the company to purchase the multiple seats one.

    considering my terrain changes "colour" (grass, or no grass:gravel) dynamically, would be nice to find a way to lay a matrix over the terrain, pre-sampling colour from it like it was in a grid.
    Or, caching the nearest light probe and average reflected colour in the direction of the Sun

    I believe it's far from being a corner case scenario if you want to use a terrain that is not approximated by a single colour on the whole surface.

    That's my personal wishlist :)
     
    Last edited: Jul 14, 2020
    LostPanda and mm_ASH like this.
  10. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Well .. I can add an onption to sample terrain splatmats in next version.
     
    NeatWolf likes this.
  11. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
    Hey, so I'm a bit confused as to whether this system can (or better said; should) be used for a large open world environment consisting of both forests and towns/cities. For the moment we are using PBS with a directional light as the sun, which is not static (day/night cycles)

    We are also using a floating origin. Will UPGEN have any issues with this?
     
    LostPanda likes this.
  12. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi! As for big open world - you can use it but as I noted two posts earlier - for full day-night cicle it's better to have cross fades between 24 groups of light presets for different time of a day. Any way for townside you need to change lighting via scripts to turn streetlights and windows of houses, so this solution with time dependand groups is not so bad.

    As it is requested alredy several times - I am thinking abount making such scripts as part of the package. =)

    Floating origin should not be a problem for fast lights. For Ray-Traced GI you need to reset their cache after reposition of world.
     
    Last edited: Jul 14, 2020
    LostPanda and Lars-Steenhoff like this.
  13. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
    Thanks for the response. I'm lucky that our world is post apocalyptic and there's not a lot of electricity ;) I'll definitely keep an eye on your asset.
     
    mm_ASH likes this.
  14. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I'm happy with the result I get when using this asset with HDRP, around 120 fast lights for 5 rooms and I get 230-300 fps on RTX 2080, I'm about to test on GTX 1060 but I guess it will be around 130-150 FPS.

    I want to ask if there is an update on the light culling system, because now a lot of lights are rendered that are in rooms, which are blocked by doors, so the player can't even see them, but they are rendered instead of the lights in front of me (I have a long corridor).
     
    mm_ASH likes this.
  15. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Culling is still in development. I would like to implement solution which will work with native unity occlusion culling system.
     
  16. CastryGames

    CastryGames

    Joined:
    Oct 1, 2014
    Posts:
    77
    urp please
     
    mm_ASH likes this.
  17. Game_DevKH

    Game_DevKH

    Joined:
    Jun 11, 2017
    Posts:
    23
    TLoU2.jpg I've seen your technique implemented in the Last of Us Part II (like when Ellie uses flashlight to spot on something colorful enough to make lights bounce). I know they use Volumetric Fog a lot in their scene. I think there must be a way Ray-Traced GI with point and spot light should work with Volume Fog.
     
    Last edited: Jul 19, 2020
  18. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Well in theory that is possible, but as for me - they use some kind of cone tracing.
     
    Last edited: Jul 19, 2020
    Game_DevKH likes this.
  19. kenlem1

    kenlem1

    Joined:
    Mar 20, 2014
    Posts:
    40
    So how expensive is this in terms of setPass calls?
     
  20. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    one set pass for any scene (to blit post effects triangle with special shader)
     
  21. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    @mm_ASH I came across your asset on the store and find it quite interesting. I'm curious how shadow casters are handled within this plugin? Are they using stock Unity shadows, or is there a custom solution involved?
     
  22. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Thank you for you interest! UPGEN Lighting use built-in lights and shadows mechanism, all it features will be added on top of the image which Unity provides.
     
  23. local306

    local306

    Joined:
    Feb 28, 2016
    Posts:
    155
    Gotcha. So in those demos scenes where there are many lights, they aren't all actually casting shadows? :p
     
  24. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
  25. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    This is a really cool asset and I'm looking into purchasing it for the standard pipeline.

    One question I had is something I noticed you answered a bit above for day/night systems.

    From what I've read it seems like using the rayraced GI with a directional light would work for allowing full day/night (tho not optimal)

    I see you suggested using 24 groups (or however many phases) and lerping between them for different phases of day.

    My question then is, how would you go about placing these lights?

    In the documentation you suggested using raytraced first to get a reference for how it should look, then manually placing. Unless its already added why not just allow us to "bake" a layout for the fast lights from the raytraced layout.

    Also for lerping do you by chance provide a way to lerp between light groups? Or do you suggest we manage that system on our own, likely by looping through all the lights and adjusting the intensitys based on the phases.


    Also It'd be cool to provide more in depth raw tutorials explaining the features, I always find videos like that very useful to see the tool in practice.

    Anyway thank you for this amazing asset, I'm looking forward to using it.
     
  26. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139

    Edit* Ah I see you said there is a button for extracting the lights from the Raytrace, my bad.
     
    mm_ASH likes this.
  27. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    As for groups lerping yes it sounds like a good idea for new feature.
    As for videos you are right but unfortunately they take too much time to make so I am doing them when there is no other options =)
     
    Foxaphantsum likes this.
  28. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi

    I make (runtime) procedural architecture, but nighttime interior point lights are ☠
    Screen Shot 2020-08-12 at 8.00.40 AM.png

    Your fast lights look very interesting…. I'm placing my lights procedurally, and randomizing their color/brightness with Playmaker. (I hate those specular hotspots)… Can you see any problem using your fast lights this way?

    I read the docs, but have some questions:

    1. If I exceed the 90-something fast lights within the camera view, do the extra lights wink out, or… what happens?

    2. There are no shadows on fast lights (or the GI lights)? They are essentially 'ambient' point/spot lights?

    3. Do they light skinnedmeshes? Or, how are skinnedmeshes handled in the postprocessor?

    4. are there any shader restrictions? will my shaders need to be Upgen-aware?

    5. Can I limit the effect to render layers, like regular lights?

    :) thank you!
     
  29. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    0. Fast Light does not produce specular highllights
    1. 97th and other lights in the current view will be just ignored
    2. Yes, if you want to have shadows you need to use basic lights and turn their shadows on
    3. Yes, they light any kind of opaque and cutout shaders including skinned ones
    4. No, you can use any kind of shaders, only requirement is deferred rendering path (HDRP is deffered by default, in Built-in SRP you need to set this path manually)
    5. No, unfortunatly this is not possible, effect just applied on top of already rendered G-Buffer, so it does not know anything about real geometry and it's layers
     
    wetcircuit likes this.
  30. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ok wow. It took about 2 minutes to set this up and it's already fun!
    I'm glad I bought it.

     
  31. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Happy to hear that you like it =)
     
  32. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi again… I'm placing refection probes along my player path, but of course Upgen is not seen in the reflections since they live in post-processing… so my reflections are too dark.

    Screen Shot 2020-08-17 at 10.11.06 AM.png

    I'm wondering if this is a problem you have possibly already solved? Maybe you can point me towards a solution?
     
  33. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    I have no built-in solution in box right now.
    In this case you need to render Reflection Probe with posteffects (at least with UPGEN Lighting).
    In HDRP you can try to do that using volumes and Custom Frame Settings (link).
    For BuiltIn renderer you need to render cubemap using active camera.

    Another solution which I am using inside our games - before rendering reflection probe temporary replace all fast lights with point lights, bake probes and than just destroy them. If will need such solution I can implement it as part of both packages.
     
    sjm-tech and wetcircuit like this.
  34. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Cool! multiple suggestions! :cool:
    I'm trying a (built-in) cubemap capture… so I wasn't too far off.

    ;) adding a bunch of temporary lights sounds very easy though, and no textures to manage.
     
    mm_ASH likes this.
  35. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Hi,i have two questions about this plugin.

    1.does the raytrace light placement system have some LOD like system?
    for example:fewer light points on a big building 100m away and more light points on nearby props?

    2.does this plugin automaticly handles cleaning unused light point?
    for example:decrease the amount of light points 100m away and delete the light points 300m away.

    these 2 function are important for huge open world game but i don't see any distance related option in document.
     
  36. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!

    Not exactly. It prioritize Fast Lights by distance from camera, by distance from look direction and by their radius. You will any way will not get more that 96 Fast Lights in the frame.

    Right now - no, it will try to render as much Fast Lights as possible even on huge distance. All idea about Fast Lights is their high performance, so you do not need to worry about optimization of their count / size or distance culling. But if you need I can add distance culling, that will be super easy.
     
  37. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    Thank you for reply.
    I have bought your plugin already.
    it's amazing!
    but i found it project the rays based on the light position only.
    for point light and spot light it's right way.for direction light it's totally a bad way.
    you might want to project the rays inside the camera view when there is a direction light.
    BUT,THANK YOU FOR THIS AWESOME PLUGIN!I LOVE IT!
    about the culling and lod system,please add it,this plugin will goes better and better!
     
    mm_ASH likes this.
  38. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Ok :)
    will add more options to control culling
     
    LostPanda, Freznosis and wetcircuit like this.
  39. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    Nice plugin. :)

    How well does a fast light handle constant moving? Like what if I attached 40 fast lights to a moving object like a plane or something else moving at a high speed?
     
  40. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Thanks!
    Moving of any amount of fast lights should be handled without any problems
     
  41. Ryan-Hayle

    Ryan-Hayle

    Joined:
    Feb 16, 2014
    Posts:
    142
    Is there an upgrade option if you own 1 version already?
     
  42. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    This sounds like a good idea. I have added option to update from HDRP to Standrad and back.
     
    wetcircuit and Ryan-Hayle like this.
  43. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    Last edited: Sep 16, 2020
  44. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    yes they should be compatible - UPGEN Lighting is a posteffect, so it will contribute to image on top of lightmaps
     
  45. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
  46. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    no it is not
     
  47. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    509
    I may give it a try, the thing is that I barely use unity lights anymore, everything is upgen fast light so not sure how that will work with his bakery directional / point lights
     
    mm_ASH likes this.
  48. Leniaal

    Leniaal

    Joined:
    Nov 7, 2012
    Posts:
    119
    Hi, I purchased the asset to see how it would work in my open world scene. But I'm confused on how I should setup the lighting. The situation is:

    - One directional light (sun, can cycle day night so not static)
    - Floating origin (so world is not static either)
    - Many inside and outside environments

    Impression:
    upload_2020-9-25_12-30-23.png

    Do you have a guide on how to setup such a scene? I've seen you mention placing of Fast Lights (either manual or semi-automatic), is this something the asset can do for you?

    EDIT: Reading a bit more about it on the first page of this thread, it's gotten a bit clearer. I'm definitely interested in a fully dynamic solution (if possible), because I'm still playing around with the lighting and the scene.

    Let's say I disable the day night cycle, is there currently a satisfying option for me that doesn't require me going through the scene and placing lights? If not, do you have any plans for this in the future?

    Cheers.
     
    Last edited: Sep 25, 2020
  49. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    First of all - tweak ambient lighting in your scene to get rid of too black shadows.
    In this case you need to make a lot of coding to make indoors and outdoors work together.
    No good solution out of box for this situation, sorry. My plugin can extract small amount of Fast Lights around position of Directional Light and you can do this many times for key areas. But to cover such huge landscape you should place Fast Lights manually, but interiors... As for me in this situation it is easier to just interpolate ambient lighting gradient when you enters some building to darker version.
     
  50. AbyssWanderer

    AbyssWanderer

    Joined:
    Mar 15, 2016
    Posts:
    77
    Hey!

    After reading your concept and watching the videos I bought Upgen-Standard at once!

    Unfortunaely, I cannot import it properly:
    upload_2020-9-28_10-17-23.png

    Am I missing some package (couldn't find it in Manual on Asset Store page)?
    Adding "Post Processing Stack" (which is deprecated) wouldn't help.

    Tried in Unity 2019.4.4f1 and 2020.1.0b16 (both empty projects, built-in render pipeline).