Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

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
    Hi!
    First of all thanks for you buy!
    It use only default packs, just install them from Package Manager window.
    This is how it looks on my side:
    upload_2020-9-28_11-3-30.png
     
  2. AbyssWanderer

    AbyssWanderer

    Joined:
    Mar 15, 2016
    Posts:
    77
    Damn, I should have looked in Package Manager's category "Unity Registry" - there is 2.3 version.
    To me, this Package Manager is still inconvinient…

    Thank you, man.
    Enjoing your perfomant lights now!
     
    mm_ASH likes this.
  3. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    294
    Hi,

    On some of my shaders the light makes an opaque object behave as transparent. This is just a sample shader from Amplify Shader Editor. Any idea why this happens or what I could do to fix it?

    Unity_2020-09-29_17-17-05.png Unity_2020-09-29_17-16-38.png
     
  4. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    This is because that shader does not write to Z-Buffer.
    UPGEN lighting just renders on top of the frame using DepthTexture.
    So seems that cube shader needs to be updated, the should be an option in Amplify Shader for Z-Write.
    For this shader you will also have same problems with SSAO and SSR effects, because they also use depth buffer information.
     
    Last edited: Sep 30, 2020
  5. frbrz

    frbrz

    Joined:
    May 10, 2016
    Posts:
    72
    Looking forward to UPGEN for URP. Hope it works with AO somehow.
     
    mm_ASH likes this.
  6. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    294
    Thanks for the reply. I turned on Z-Write and it didn't fix it. I wonder if it is a problem with the Custom Lighting node in Amplify Shader Editor? I will try and ask their support.

    2020-09-30_17-07-33.png
     
    Last edited: Oct 1, 2020
    mm_ASH likes this.
  7. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    244
    Hello, I've been testing the GI Textures scene and noticed if I swap the texture source on the material during runtime the lighting colour doesn't update to reflect the change, is there a method to perform this update once the texture is swapped. Otherwise, everything is great so far thanks.
     
    mm_ASH likes this.
  8. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    Add this method to UL_Rays.cs somewhere in the end of that class:
    Code (CSharp):
    1. public static void ClearCache() => _cachedRendererColor.Clear();
    And call it after you change material textures.
     
    Beloudest likes this.
  9. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    294
    Just a little quality of life suggestion. Usually when you create a new object in Unity through menus, it gets selected after you create it. :)

    Inside of eUL_MainMenu.CreateGameObject()

    Code (CSharp):
    1. Selection.activeObject = go;
    2. return go;
     
    mm_ASH likes this.
  10. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Good point - will be added in next update.
     
  11. Beloudest

    Beloudest

    Joined:
    Mar 13, 2015
    Posts:
    244
    Thanks
     
    mm_ASH likes this.
  12. merpheus

    merpheus

    Joined:
    Mar 5, 2013
    Posts:
    193
    Hi, we bought the plugin a while back for HDRP but going back and forth between which render pipeline to use, so is it possible to access to Built-in version if we contact you with the Invoice number?
     
  13. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi, sure
     
  14. MicCode

    MicCode

    Joined:
    Nov 19, 2018
    Posts:
    57
    Hi, I see in the description that UPGEN use physics collider for light bounce.
    My game use the new ECS unity physics.
    Does UPGEN support unity/havok physics?
     
  15. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi
    Did not tested it with new physics.
    UPGEN uses standard Physics.Raycast method to proceed bounced lighting.
     
  16. athosrojas

    athosrojas

    Joined:
    Jun 26, 2017
    Posts:
    74
    before buy i want to know if it works with unity 2020 HDRP , and... SSS, all volums effects from hdrp( screen space reflections, screen space ao , screen space shadows, planar reflection probes) all that to render animations using unity recorder to render animations in both normal image formats and 360 monoscopic and stereoscopic , i was having problems with SSS shader from David miranda to render 360 stereoscopic images, cause i need a realtime GI workflow. so i was using legacy pipeline , but i dont have restritions to hdrp ( i like it more )
     
  17. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    In 2020 stereorendering is not supported for this assets.
    But you can contact me via mail to clarify details of your project, maybe we can find a solution.
     
    Last edited: Nov 5, 2020
  18. athosrojas

    athosrojas

    Joined:
    Jun 26, 2017
    Posts:
    74
    thx i will think about .
     
  19. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    295
    Hi I want to be able to change the material properties of the surfaces in Play mode, but the change doesn't gets updated on the light.

    If I change the color in Edit mode, and enter play mode, the change gets taken into account, I assume you do some initialization in start or awake, so how can I trigger that manually everytime I make a change to my materials?

    upload_2020-11-29_6-26-18.png
     
  20. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    Yes it does caching of renderer colors to improve performance.
    If you change materials during runtime you need to reset cache.
    To do this after changing material you should call UL_Rays.Ray.ClearCache()
    But do not call this each frame if possible =)

    To update it during edit-time you can add e.g. main menu command into eUL_MainMenu.cs
    Code (CSharp):
    1.     [MenuItem("GameObject/UPGEN Lighting/Clear Cache", false, 10)]
    2.     public static void ClearCache() => UL_Rays.Ray.ClearCache();
     
    Last edited: Nov 30, 2020
    daville and wetcircuit like this.
  21. DigitalGlass

    DigitalGlass

    Joined:
    May 12, 2009
    Posts:
    88
    Can you do both? Use a directional light with ray-traced GI and also place hundres of fast lights?
     
  22. daville

    daville

    Joined:
    Aug 5, 2012
    Posts:
    295
    Thanks for your answer.

    Just one small suggestion / request: It would be awesome if the Lighting manager had a button or something to change temporally all of the fast lights for unity's point lights.

    This could be useful for me when rendering Reflection probes, and then turn it off again.
     
  23. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Sure, will add such function in next update.
     
    daville and wetcircuit like this.
  24. Deleted User

    Deleted User

    Guest

    Can the GI work in open forest areas? and is the GI as accurate as the enlighten Realtime GI which unity deprecated last year?
     
  25. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Yes it can work in forest.
    It is very inaccurate, much more that enlighten was.
     
  26. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    121
    How's URP support development going? I'll be instantly buying when it comes out :)
     
  27. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Unfortunately it was postponed to the next year.
     
  28. RPowers

    RPowers

    Joined:
    May 14, 2015
    Posts:
    121
    Ok I hope it comes out at some point, but that's ok! Thanks, I appreciate the quick response
     
    mm_ASH likes this.
  29. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    247
    Hi there, the plugin is decent for what its worth I like how it bounces and all, seems a bit too inaccurate for a raycast one, thought.

    The issue I have mostly is the LUX values, so the light has to be way blown up for the GI to even act, which brakes the physics by quite a lot, for instance my "flashlight" of 1200 lumens (which is quite high) bearly makes reflection on intensity of 4.
    upload_2020-12-29_8-49-53.png

    Latest unity 2020.2.0f1
     
  30. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    Try to play with value of constant BOUNCED_LIGHT_BOOST (UL_RayTracedGI.cs)
     
  31. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    247
    Thanks for your reply! Seems better, however, I've noticed some stuff as well, if you could point me if I'm doing somethign wrong or not.

    So if I point the light at the wall, it reflects the GI quite nicely, and smoothly, however if I push it to the ceilling it doesn't reflect almost anything (really dimmed).

    Is this a natural limitation or?

    upload_2020-12-31_1-48-7.png

    upload_2020-12-31_1-48-18.png
     
  32. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    No there is no such limitation, it shoud reflect lighting. Maybe your floor has no colliders?
     
  33. VisualTech48

    VisualTech48

    Joined:
    Aug 23, 2013
    Posts:
    247
    All has a box colider thus I ask.
     
  34. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Maybe colliders layer is ignored by raycasting?
    Also try to add Manager component to your scene and visualize bounced rays. Maybe they just too dark?
     
    Last edited: Jan 6, 2021
  35. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    If you are experiencing "pink triangle" problem - this happens because Unity did not compiled shader code correctly, you need just reimport it PinkTriangle.png .
     
  36. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    v1.6
    * Manager: new button to Create/Destroy set of Point Lights from internal rays
    * Ray-Traced GI: Increased Maximum value of RaysMatrixSize from 15 to 25

    Before baking reflection probes you can substitute UPGEN lighting with a set of Point Lights. To do this you should create a Manager component (somewhere in the scene) and press the “Generate Point Lights” button. After baking you can delete them by pressing the “Destroy Point Lights” button.
     
    Last edited: Jan 7, 2021
  37. shi946

    shi946

    Joined:
    Jun 3, 2019
    Posts:
    16
    TLDR: Fast point lights leak light through 0-2+m walls, maximum number of fast point lights seem to be limited to ~100. Using more will start fading out lights far away (and cap nearby fast point light range?).

    Hello, I'm trying to test an idea for a dynamic fake GI lighting solution and am enjoying the lighting speed but have issues with the range and relative camera position with fast point lights. Attached below is a picture where lights were spawned in a grid on awake, with only lights shown in green turned on. Lights color is same as default directional light color. This is inside a closed room with a door. Walls/ceiling are green, ground is white, standard material. All lights are spawned at least 0.2m from an object to try to avoid leaking. The green points at the top of the picture are lights outside the room.

    The issues:
    1. Increasing the range of all fast point lights past ~1.8 starts to shrink blob of white and green on the floor and wall, respectively. This is intensity independent. At the same time, strange lights appear at the corners of the room (see top right of the picture) and increase in size as the range further increases past ~1.8.
    2. Backing up the camera by ~ 2m (still staying well inside the room) causes all three blobs in the picture to disappear. This is range and intensity independent. Moving the camera forward by ~1m causes a green light to appear at the edge where the front wall and ceiling meet. In other words, it seems that point lights get disabled at a certain distance.

    upload_2021-1-20_1-29-27.png

    Edit: Decided to try spawning lights that could only "see" the directional light and inside the room (aka no point lights above ceiling). Got a significantly more realistic scene and think I found the reasons for the two above issues:
    1. Seems like fast point lights can go through walls at up to at least 2m thickness (haven't tested higher). This is independent of point 2 below. Explains the lights leaking near the ceiling in the above picture.
    2. Seems to be a maximum number of fast point lights in the scene (100?). With more than ~100, seems like fast lights far away will start fading? Also, below ~100, range can be increased indefinitely too.

    upload_2021-1-20_2-12-40.png

    Please let me know if I'm somehow using the asset wrong... Otherwise, is it possible to get fast point lights that don't go through walls and increase maximum number/culling distance of point lights in the scene?
     
    Last edited: Jan 20, 2021
  38. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    What you are doing looks really interesting.

    1. I can guess this this light "blobs" are result of sum of too many fast lights in small area (possibly because of numerical noises).

    2. When you moving camera back more other fast lights will get to your frame, so some amount of fast lights that are producing "blobs" could get lower priority and because of that not rendering.


    Just to clarify few things:
    * 100 fast lights is not a scene limit, it`s a frame limit
    * fast lights goes through the walls - they are just a post effect, so they do not know about geometry of the scene

    Also you can make your own implementation of lighting, which will spawn Fast Lights directy for effect rendering on the fly, not MonoBehaviour wrappers (aka Fast Point Light) which are more memory and performance consuming. If you need more help with that, contact me in discrod (Anton Tril#2467) or by a mail.
     
  39. shi946

    shi946

    Joined:
    Jun 3, 2019
    Posts:
    16
    Thank you for the reply. I see. Performance is not an issue so far. Actually, most fps loss is from all the raycasting/math.

    Is it possible to work around the frame limit by spawning fast lights directly like you mentioned? Right now, that's the only major issue. Is the "#define MAX_LIGHTS_COUNT 96" in the shader code related?

    I'll probably move everything to compute shader and probably draw on the mesh directly if this idea is any good. At the very least, your asset helped me prototype quickly :)
     
    Last edited: Jan 21, 2021
  40. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    No, it`s just a faster way to spawn list of all fast lights (for each frame), from which any way renderer will take 96 most important. Changing this constant to higher value should linearly decrease rendering speed of this post effect.
    Yes, computing shader could make any thing better ;) I am happy that you found it helpful. Initially I`ve published this asset to inspire other developers and share my humble idea with fast postprocessed lighting :)
     
    shi946 likes this.
  41. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    378
    Hi!
    Is there a way to spawn more than 96 lights or increase the ray matrix size for Ray-traced GI at the cost of performance?

    I'm testing it with a simple two-room box. One has a window and a point light to fake some sunlight (I can't use a directional light for a number of reasons that will be off-topic here). The first room receives GI nicely, the walls of the second room either receive it as well or just receive some light leaks from the first room. But the front wall with the entrance is completely dark, so, no bounced lighting. The debug gizmos show me that the majority of the upgen fast lights are spawned inside the first room and only a couple of them get inside the second one:



    I've tried to play with BOUNCED_LIGHT_RANGE and BOUNCED_LIGHT_BOOST, but this doesn't help a lot. So I figured I need more lights.

    Here's a baked GI for comparison:


    I know that it's not supposed to look like a baked variant, but I'm sure something can be done to give this dark wall some bounced lighting.

    Thanks!
     
  42. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    You can as many GI lights in the world as you need, 96 is a limit for one frame.
    For your situation you should just place one fast light manually in the center of small room to achieve good visuals (same to baked image) and good performance.
     
  43. Passeridae

    Passeridae

    Joined:
    Jun 16, 2019
    Posts:
    378
    I'm planning to close and open doors to such rooms in runtime. Ray-traced GI acts accordingly to these changes and cuts off fast light spawning in the room if the door is closed. It also does it procedurally, so when the door is opening, GI effect is growing according to the widening door gap. If I had a light already inside the room, then increasing and decreasing its intensity with the door movement would look strange.
     
  44. Chajabinx

    Chajabinx

    Joined:
    Dec 7, 2017
    Posts:
    3
    Hello! I have been using UPGEN standard and I finally got it to work. What I have noticed is that I am using Toony Shaders 2 Pro ( this asset here https://assetstore.unity.com/packages/vfx/shaders/toony-colors-pro-2-8105) and for some reason UPGEN doesn't work with it. If I use the standard shader the UPGEN fast lights show up but not on gameobjects that use the toony colors shader.

    My question is, is there any way to get the UPGEN fast lights working with custom shaders?

    Any information would be amazing. Thank you!
     
  45. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    hi!
    It works pretty well with other shaders if they output all needed information to G-Buffer.
    Maybe you can provide some screenshots?
     
  46. Chajabinx

    Chajabinx

    Joined:
    Dec 7, 2017
    Posts:
    3
    Hello!

    Thank you so much for your reply. I took some screenshots for your reference:

    Here you can see an UPGEN Fast Light over the floor tiles not lighting up the scene with the Toony Shader.



    And here is the exact same scene but with the Standard shader applied to the gameObjects.



    Is there any way I can fix this so that it also works with the Toony Shader?
    I am guessing the issue lies in what you stated about the G-buffer?

    Thanks again and I hope to get this fixed!
     
  47. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi! Thank you for screen shots.
    Yes you should check what information is written from this Toony Shader in G-Buffer, first of all it should output Albedo, Normals and Depth values. Seems now it does not provide anything from that. I am not familiar with that shader but maybe it has some settings to customize output for deferred rendering path?
     
  48. Chajabinx

    Chajabinx

    Joined:
    Dec 7, 2017
    Posts:
    3
    Hello!
    Thank you so much for the answer and the information!
    To be honest, I am terrible with shaders and I would have no idea on how to even begin checking for information regarding G-buffer and its output to albedo, normals and depth values :D

    I will try reach out to the developer of the shader to see if maybe they can help me with that!
    Thank you for your help and pointing me in the right direction :)
     
    mm_ASH likes this.
  49. angelo9888

    angelo9888

    Joined:
    Feb 16, 2013
    Posts:
    9
    Hello there!
    I really love your asset!
    Two features that I would like to see in the future:
    1) Ignoring trigger colliders.
    2) Work with unity's culling system.

    Keep it up!
     
    mm_ASH likes this.
  50. mm_ASH

    mm_ASH

    Joined:
    Nov 15, 2013
    Posts:
    358
    Hi!
    Thanks for the feedback =)
    Keep working!