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

Lighting Box 2 Next-Gen Lighting Solution

Discussion in 'Assets and Asset Store' started by UnityLighting, Jun 9, 2017.

?

Unity Version

  1. 5.4

    2.4%
  2. 5.5

    1.3%
  3. 5.6

    16.5%
  4. 2017

    79.8%
  1. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  2. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    This is also a usefull way to simulate offroad race tracks :
    photo_2018-01-05_03-06-09.jpg
    photo_2018-01-05_03-06-02.jpg photo_2018-01-05_03-06-04.jpg photo_2018-01-05_03-06-07.jpg photo_2018-01-05_03-06-09.jpg

     
    robymv and petersx like this.
  4. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Here you can see how to use particle as volumetric fog and light effects:


    Particle Fog effects has been used in all next gen games to add volumetric effects into outdoor games:
    photo_2018-01-05_09-47-50.jpg photo_2018-01-05_09-47-52.jpg


    ..........
     
    ftejada, Rowlan, red2blue and 2 others like this.
  5. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Fake volumetric effects based on Particle system shader (Frostbite Style):
    photo_2018-01-05_10-26-22.jpg photo_2018-01-05_10-26-25.jpg photo_2018-01-05_10-26-26.jpg photo_2018-01-05_10-26-27.jpg photo_2018-01-05_10-26-28.jpg
    photo_2018-01-05_10-26-26.jpg
     
    petersx likes this.
  6. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    New video tutorials for 2.7 from start to end of the upgrading game graphics to a high level

    Also unity's tree creator is awesome :
    - Very easy to use
    - Free
    - Is Fully Compatible with unity terrain component
    - Maximum performance (compare to Speed Tree Meshes)
    photo_2018-01-05_15-34-17.jpg photo_2018-01-05_15-34-30.jpg photo_2018-01-05_15-34-31.jpg photo_2018-01-05_15-34-33.jpg photo_2018-01-05_15-34-35.jpg
    photo_2018-01-05_15-34-17.jpg
    photo_2018-01-05_15-34-30.jpg
     
  8. buttmatrix

    buttmatrix

    Joined:
    Mar 23, 2015
    Posts:
    609
    This is pretty good man, nice job!

    Are you increasing the terrain resolution (pixel error) in realtime near the transform of the gameobject (truck)?

     
  9. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    No

    Unity terrain resolution is fixed
     
  10. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  11. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    152
    Ali,

    Is that terrain deformation upon tire hit a script ?
    Is this scene included in the latest version?
     
  12. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Tree creator tutorials

    photo_2018-01-06_07-29-19.jpg photo_2018-01-06_07-29-44.jpg photo_2018-01-06_07-29-46.jpg photo_2018-01-06_07-29-48.jpg
    photo_2018-01-06_07-29-19.jpg
    photo_2018-01-06_07-29-46.jpg
    photo_2018-01-06_07-29-44.jpg
    Deformation script for terrain and another for tire (wheel colliders)
    Will be available in 2.7
     
  13. tri-stratos

    tri-stratos

    Joined:
    Jan 29, 2013
    Posts:
    152
    Ali,

    May the terrain deformation be limited/masked in a certain terrain area (ie road) or this affects everything?

    Btw, when 2.7 is expected to be available ?
     
    blitzvb likes this.
  14. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    You can use triggers

    I will upload 2.7 now into asset store

    will be available in few days (I don't know about holiday)
     
  15. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    LB 2.6.1 on Unity 2017.3:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.RenderBuiltins (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context, System.Boolean isFinalPass, System.Int32 releaseTargetAfterUse) (at Assets/VISUAL/LightingBox2/PostProcessing2beta3/Runtime/PostProcessLayer.cs:750)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.Render (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Assets/VISUAL/LightingBox2/PostProcessing2beta3/Runtime/PostProcessLayer.cs:651)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Assets/VISUAL/LightingBox2/PostProcessing2beta3/Runtime/PostProcessLayer.cs:416)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Assets/VISUAL/LightingBox2/PostProcessing2beta3/Runtime/PostProcessLayer.cs:278)
    UnityEngine.GUIUtility ProcessEvent(Int32, IntPtr)
     
  16. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    This is from post processing stack

    clear the error or reopen project
    2.7 has been used post processing stack b4
     
  17. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    So 2.6 is not recommended for Unity 2017.3.0?
     
  18. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
  19. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,199
    @aliyeredon2 There seems to be a bug in version 2.6 on the store. When you open the Nature scene, the whole tree distorts with the wind, even the trunk. Also the grass shines through the trunk.

    Speaking of wind, is there a reason why you use your own shader for the trees? It makes the speedtrees static, i. e. not animated for other applications which use the Unity built-in windzones. Of course one can always use the trees from the Standard Assets, just asking what the benefit of your shader is.
     
    Last edited: Jan 8, 2018
  20. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    @aliyeredon2 Make sure to test LB 2.7 in 2017.3.0 extensively. 2.6 seems to be really broken in the latest Unity which introduced some code changes.
     
    blitzvb likes this.
  21. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    I already tested 2.6 on 2017.3 without problem
    I think the problem is from lighting box or Post Stack codes

    Current version will be works without problem on 2017.3 :

    You must change trunk shader to Standard manually

    In the latest version i have focused on unity's own tree creator

    https://www.youtube.com/playlist?list=PLVXvfvDWvto2_wRRQ6Xu7tQaer-H4x6wP
     
    AGregori likes this.
  22. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  23. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Updated import Guide:




    Import into existing lighting box 2+ (Upgrade Lighting Box into latest version):

    - You must remove old update before importing latest version:
    1. Select Lighting Box 2 folder from your project files
    2. Delete lighting Box 2 folder
    3. Import latest version from asset store


    Import for the first time:

    Lighting Box 2:

    Note:
    Post Processing Stack 2, True Volumetric Light and SSR+DOF effects already imported into lighting box 2 package.
    So you need to remove all of them before importing Lighting Box 2

    First Clean your project from any image effect:
    Typical paths:
    Standard Assets->Image Effects
    Editor->Image Effects

    1. Import the asset on a new empty project
    2. Go to Edit->Project->Player
    3. Unchecked Auto Graphics API and remove DirectX9 (on windows, i don't know on mac)
    4. Press "Ctrl + E" or select Window->Lighting Box
    5. Select "New" button from Profile slot to create a new lighting profile (if your scene was unsaved, first you should save your scene)
    6. Select "New" button from Post profile slot
    7. Now watch the videos to learn how to use Lighting Box 2 :

    https://www.youtube.com/playlist?list=PLVXvfvDWvto2iyblD-GUGF5cBAQzL5nGi

    Follow topic:
    https://forum.unity.com/threads/mad...2-7-next-gen-lighting-solution.475644/page-44

    Follow tutorials:
    https://www.youtube.com/channel/UCKGKwkmZagsc0QKTkWn_w-w/feed?view_as=subscriber

    Lighting Box 2.7 tutorials:
    https://www.youtube.com/playlist?list=PLVXvfvDWvto2_wRRQ6Xu7tQaer-H4x6wP

    Lighting Box tutorial playlist:

    https://www.youtube.com/playlist?list=PLVXvfvDWvto3JOyltaJ5NnlxWWW1yA15q
     
  24. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I'm having a question / problem.
    fx1.png

    In the screenshot you can see that I don't have any effects activated (all checkboxes are un-checked).
    However, when I click "Effects On", the game view changes drastically.
    What is going on here?
    If this button is related to anything else but the effects shown here (Volumetric Lighting, Sun Shaft, Global Fog, etc.), you need to make it clear what this button is about exactely.

    2 suggestions which I found very important:

    1) Can I suggest to rename the button caption from "Effects on" to "Effects are on" and "Effects off" to "Effects are off"? This makes it muuuuch easier to understand.
    2) Can I also suggest to make the "Refresh" button a regular button? Because currently it's impossible to say if a click was recognized because it doesn't have any push-state effect or so.
     
    blitzvb likes this.
  25. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    267
    does your product support forward rendering for VR?
     
  26. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Hi

    I will check these suggestions

    1. OK

    2. This will update Undo changes
     
  27. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    I don't know anything about VR
     
  28. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  29. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  30. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    Errors when importing to Unity 2017.3.0f3

    NullReferenceException: Object reference not set to an instance of an object
    LB_LightingBox.OnLoad () (at Assets/LightingBox2/Scripts/LB_LightingBox.cs:2881)
    LB_LightingBox.OnEnable () (at Assets/LightingBox2/Scripts/LB_LightingBox.cs:297)
    UnityEditor.EditorWindow:GetWindow(String, Boolean, Type[])
    LB_LightingBox:Init() (at Assets/LightingBox2/Scripts/LB_LightingBox.cs:174)

    when turning on global fog -
    NullReferenceException: Object reference not set to an instance of an object
    LB_LightingBoxHelper.UpdateFog (UnityEngine.Camera mainCamera, Int32 fogType, Single fogDistance, Single fogHeight, Single fogHeightDensity, Color fogColor, Single fogDensity) (at Assets/LightingBox2/Scripts/LB_LightingBoxHelper.cs:1312)
    LB_LightingBoxHelper.Update_GlobalFog (UnityEngine.Camera mainCamera, Boolean enabled, CustomFog fogMode, Single fogDistance, Single fogHeight, Single fogHeightDensity, Color fogColor, Single fogDensity) (at Assets/LightingBox2/Scripts/LB_LightingBoxHelper.cs:1219)
    LB_LightingBox.OnGUI () (at Assets/LightingBox2/Scripts/LB_LightingBox.cs:1462)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:295)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:288)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:255)

    Never adds post proc scripts or anything to camera.

    When opening the LB2 window it resizes my editor to be slightly larger than my monitor. Not breaking, but pretty annoying. Any time i click on the tab it resizes. I have stacked monitors so it may be Unity editor just not playing nice.
     
  31. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Re open the project

    Watch videos

    https://www.youtube.com/playlist?list=PLVXvfvDWvto2_wRRQ6Xu7tQaer-H4x6wP
     
  32. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132
    Is it possible to swap the Lighting profiles at runtime? Im having trouble figuring it out. Basically I want a different profile depending on what prefab I load.
     
  33. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    See trigger based profile switch example in sample scenes
     
  34. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    I did watch the videos, not much there as far as importing goes. I did follow these instructions exactly: http://89.163.206.23/LightingBox2_Install.txt

    And still get the error. I totally wiped out LB1 and 2 from my project, all image effects, etc, and reimported LB2 2.7. Still get the error. Tried the 2.6 and 2.5.3 options available. All of them have the errors and the resize window issue.

    Thanks,
     
  35. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Mac or Win?

    try on an empty project

    try on a new scene
     
  36. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132
    Im trying to modify the Start() method from the trigger switch script,so it switches the profile when a prefab is loaded.
    I attach the script to the prefab to be loaded -

    Code (CSharp):
    1.   void Start()
    2.     {
    3.         helper = GameObject.FindObjectOfType<LB_LightingBoxHelper>();
    4.         orginalProfile = helper.mainLightingProfile;
    5.  
    6.         if (!mainCamera)
    7.         {
    8.             if (GameObject.Find(profile.mainCameraName))
    9.                 mainCamera = GameObject.Find(profile.mainCameraName).GetComponent<Camera>();
    10.             else
    11.                 mainCamera = GameObject.FindObjectOfType<Camera>();
    12.         }
    13.  
    14.         UpdatePostEffects(profile);
    15.         UpdateSettings(profile);
    16.         Update_Sun(profile);
    17.         print("script was enabled");
    18.     }
    So far this is not working. The idea being that when it loads, it will switch out the lighting profile, but as I said, it doesn't seem to work at all.
    I don't need a collision based trigger, just something that can change the profile when a prefab loads.
     
  37. Fairennuff

    Fairennuff

    Joined:
    Aug 19, 2016
    Posts:
    88
    Windows.

    Works fine in a new project. This is a VR project using VRTK, as part of it, it handles Oculus and Vive. But both the cameras are disabled until the game starts and it detects what VR device is being used. I think the problem may be somewhere in there.
     
  38. CoilSpot

    CoilSpot

    Joined:
    Aug 28, 2017
    Posts:
    24
    Hi aliyeredon

    Can Glass shader in HD Glass Pack work for import object from external at runtime?
    ex : import fbx file at runtime then assign your glass shader.
     
  39. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Hi
    Yes you can change the material (is better) in runtime
    search on unity page about how to change material or shaders in runtime script

    I don'nt know anything about VR

    you can fix window resize issue by removing line 186 and 187 then activating line 184 :

    Untitled.jpg
     

    Attached Files:

  40. Steviebops

    Steviebops

    Joined:
    Apr 9, 2013
    Posts:
    132

    I tried putting this in an Awake() method, but Im still not getting results. I attach it to the prefabs, so it should work as they are loaded, but for some reason it isn't.
     
  41. AGregori

    AGregori

    Joined:
    Dec 11, 2014
    Posts:
    527
    Beta5 is out, and it's the first dedicated version to support 2017.3.0.

    When will LB support beta5?
     
  42. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866

    Yes

    I will update LB to 2017.3 soon
     
    AGregori likes this.
  43. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Updated to Post Processing Stack 2 Beta5 and Unity 2017.3
    Added Fog prefabs (+ night shaft fake effects)
    Recorded Work in progress videos

    photo_2018-01-14_10-56-13.jpg photo_2018-01-14_10-56-19.jpg photo_2018-01-14_10-56-20.jpg photo_2018-01-14_10-56-21.jpg
    photo_2018-01-14_10-56-13.jpg
    photo_2018-01-14_10-56-19.jpg
     
    Rowlan, Gametyme, blitzvb and 3 others like this.
  44. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Unity's tree creator tutorials will eb available after upload:

    Also prefabs and sample scene will be availabele in n 2.7.1 update

    Tree Creator compare to speed tree:
    - Very easy to use
    -Translucency and AO and Shadow generator
    - Automatic billboard generation on terrain component + billboard system (optimization)
    - Free and optimized
    - Wind support


    photo_2018-01-14_22-59-43.jpg photo_2018-01-14_22-59-46.jpg photo_2018-01-14_22-59-47.jpg photo_2018-01-14_22-59-48.jpg photo_2018-01-14_22-59-50.jpg
    photo_2018-01-14_22-59-43.jpg
    photo_2018-01-14_22-59-46.jpg
     
  45. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
  46. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    You can download Tree Creator Tutorials with original quality (You tube version has bit lower quality):

    Untitled.jpg
     
  47. DariusRusu

    DariusRusu

    Joined:
    Oct 20, 2014
    Posts:
    16
    Hey man,

    i like your package, but i got a problem with it, i imported SUIMONO - WATER SYSTEM 2 and i got this error, i don t understand what is the problem, i turned off all the effects and still didn t worked.

    NullReferenceException: Object reference not set to an instance of an object
    UnityEngine.Rendering.PostProcessing.ScalableAO.DoLazyInitialization (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Assets/LightingBox2/PostProcessing2-Beta5/Runtime/Effects/ScalableAO.cs:45)
    UnityEngine.Rendering.PostProcessing.ScalableAO.Render (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context, UnityEngine.Rendering.CommandBuffer cmd, Int32 occlusionSource) (at Assets/LightingBox2/PostProcessing2-Beta5/Runtime/Effects/ScalableAO.cs:73)
    UnityEngine.Rendering.PostProcessing.ScalableAO.RenderAfterOpaque (UnityEngine.Rendering.PostProcessing.PostProcessRenderContext context) (at Assets/LightingBox2/PostProcessing2-Beta5/Runtime/Effects/ScalableAO.cs:136)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.BuildCommandBuffers () (at Assets/LightingBox2/PostProcessing2-Beta5/Runtime/PostProcessLayer.cs:357)
    UnityEngine.Rendering.PostProcessing.PostProcessLayer.OnPreCull () (at Assets/LightingBox2/PostProcessing2-Beta5/Runtime/PostProcessLayer.cs:292)

    Can someone help me?
     
  48. blitzvb

    blitzvb

    Joined:
    Mar 20, 2015
    Posts:
    284
    Did you put inside of lighting box, the volumetric fog that you posted earlier? I cannot find it, in the latest release :/
     
  49. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Download latest version from 2017.3 Editor
     
    blitzvb likes this.
  50. Ghost_Interactive

    Ghost_Interactive

    Joined:
    Jul 8, 2015
    Posts:
    54
    Hay guys i want share this with you, our game Ghost fighter. lighting works with lighting box 2.7 looks amazing. thanks to aliyeredon2 for making so Assam an asset.