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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

2D Dynamic Lights and Shadows Effects Optimized For Mobile - Martin Ysa

Discussion in 'Assets and Asset Store' started by Nimda001_2, Dec 23, 2014.

  1. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
  2. SpiralCircus

    SpiralCircus

    Joined:
    Feb 1, 2014
    Posts:
    34
    I'm also having the problem others have had:

    IndexOutOfRangeException: Array index is out of range.
    DynamicLight.setLight () (at Assets/2DLightAssets/2DLight/DynamicLight.cs:302)
    DynamicLight.Update () (at Assets/2DLightAssets/2DLight/DynamicLight.cs:158)

    It happens when I add new colliders at runtime, when the dynamic light script detects them.

    Anyone find a cause / solution for this?
     
  3. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    Hi dc5774,
    Are you adding Colliders with path for holes?
     
  4. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    Hi Guys, i have some advances for new version of 2DDL. I just render this scene in 0.45 ms and it has 60 boxColliders2D and 2 Cookie Lights (Gradient texturized). Which means 60X4 vertices X 2 lights X 6 Light segments = 2880 operations by frame and still down 1ml!! only 0.45 ms !

    upload_2015-9-18_8-54-57.png

    * Of course also:
    -) New types of lights (Included texturized/cookie lights)
    -) New Casters (included compatibility with all 2D Colliders - box, circle, edge!)
    -) And a lot of more things...
     

    Attached Files:

    Last edited: Sep 18, 2015
    arkhament and PhilippG like this.
  5. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
  6. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    giorgos_gs and Rodiaz89 like this.
  7. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    622
    Does these shadows work also with Sprites with normalmaps? It would be great, does your light work with normalmaps?
     
  8. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    Hi @giorgos_gs , It can work with sprites, meshes... that is indistinct while has a corresponding collider when shadows is casting.
     
  9. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    It's a bit silly to ask as I've read through everything and I know this, but just want to check before buying.

    I'm looking for a FOV solution to plonk onto enemies (with different possible ranges, change colours between states etc etc) that will detect the player.

    That is part of the pro version, right?

    Thanks :)
     
  10. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    Hi Ashley,
    Yes! FOV implementations only is available in PRO version. Include onFOV, onEnter and onExit events.
     
    ashley likes this.
  11. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    Thank you for confirming! I'll be buying the pro version shortly.
     
    Nimda001_2 likes this.
  12. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    Just seen this is reduced today so I'll pick it up. Laziness pays off sometimes! :p
     
  13. ashley

    ashley

    Joined:
    Nov 5, 2011
    Posts:
    84
    Starting playing around with it but finding myself coming unstuck. Tried experimenting and looking at your guide (http://martinysa.com/2ddl-documentation-cover-explosion-and-shockwave-bomb/) but having no joy so I hope you don't mind me asking.

    The intent is for this to be used on enemies to have a field of vision to spot the player and when they do kick off events which I've already written.

    I have attached a light with the appropriate radius and field range that I want as a child gameobject of the enemy. I have put the enemy in my 'Enemy' layer. I have a player and put it in the 'Player' layer. I've set 'Use Events' to true.

    I'm unsure/would like clarification on the following please:

    1) If I give the enemy (who has the light) a collider it immediately prevents the light from showing. How do I get around this?
    2) For the event to work, what should be looking out for what? I've changed the Layer to both Player and Enemy but I'm really not sure if 'Layer' is referring to the layer it should be looking for, is currently on, should be avoiding or what. Judging from the example scene it seems to be what its looking for (Player) but trying that I'm still having no joy.
    3) Should 'Reached Event Manager' be on the object to the be found (i.e. player) or the object that is looking (i.e. enemy - with the light also attached). Again judging from the example it's the thing being found, but not having any luck with that.

    Sorry for all the questions. I have looked at your tutorial but I can't get it to fit my needs.

    Thanks.
     
  14. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    2DDL Pro 1.3.6r3 has been released:
    What's new?

    • Unity Events compatibility & improve behaviors over OnEnter, OnExit, and OnInside Events.
    • "Sight" setup added to 2DDL menu.
    • Angle handler on scene.
    • Relative path compatibility: this mean that you can move 2DDL folder at any place.

    https://www.assetstore.unity3d.com/en/#!/content/25933
     
  15. FeboGamedeveloper

    FeboGamedeveloper

    Joined:
    Feb 2, 2014
    Posts:
    47
    Hi, I want do with my friends one game with the shadows very particular. In specific the shadows must be clean and hard. For example look this image in below (DeChirico) for understand the problem.




    The game is top-down like Zelda.
    Is it operable with this plugin? How? Thanks for answer!!!

    In addition is there a light like global directional light (all the scene is illuminated for a specific directional light)?
     
  16. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
  17. Timotius

    Timotius

    Joined:
    Mar 30, 2017
    Posts:
    6
    Hello,

    Would like to ask about how to handle image transparency (alpha) with Sprite Occluded material? It seems it won't render correctly:

    2ddl questions.JPG

    Are there anything wrong with the settings?

    2ddl questions2.JPG

    Thank you
     
  18. Nimda001_2

    Nimda001_2

    Joined:
    Sep 19, 2013
    Posts:
    63
    Hi Timotius,
    yes is an error inside the shader.

    open: 2DDL/2DLight/Shaders/occluded.shader

    and replace the line 112
    Code (CSharp):
    1. return _OccludedColor * c;
    with:
    Code (CSharp):
    1. return _OccludedColor * c * c.a;

    Greetings.
     
    Timotius likes this.
  19. Timotius

    Timotius

    Joined:
    Mar 30, 2017
    Posts:
    6
    Perfect!

    Thank you for your response
     
  20. kapopixel

    kapopixel

    Joined:
    Apr 2, 2017
    Posts:
    54
    Hey @Nimda001_2 I don't think "Lens Flare" feature is compatible with Unity 2017.1. Has anyone experienced the same?
     
  21. adrian93

    adrian93

    Joined:
    Oct 8, 2018
    Posts:
    1
    Hi @Nimda001_2
    does this work with circle colliders? im currently getting a invalidcast error but if i change it to a polygon collider it will work.
    im currently trialing it out on the free version with unity personal, do i need to buy the pro version for it to work?
    cheers
     
    Last edited: Oct 31, 2018
  22. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,805
    One question before buying - does this asset work with Lightweight Render Pipeline? Because LSRP gives a considerable performance boost on mobile and WebGL I'm switching to lightweight render pipeline. Some of the assets I use like AnyPotrait and Amplify already support LSRP.