Search Unity

2D Mesh Based Volumetric Lights

Discussion in 'Assets and Asset Store' started by reveriejake, Jul 5, 2012.

  1. eddie312

    eddie312

    Joined:
    Sep 13, 2012
    Posts:
    24
    My bad it was layer problem.

    the current build on an Iphone 6 is pretty slow.
    but the new metal support on the 4.6.3 improve the frame rate.
     
  2. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    433
    @SullyTheStrange
    Thanks! Maybe I'll look into applying for the dev kit eventually, at least after I get closer to completion on the PC version.

    @Souk21
    I believe the only way to get the smooth edges is Unity Pro. The dev has attempted to emulate them using Unity Free, but it isn't possible to do it efficiently without Pro.

    Any update news for 2DVLS?
     
    Last edited: Feb 28, 2015
  3. PKrawczynski88

    PKrawczynski88

    Joined:
    Nov 14, 2013
    Posts:
    15
    I just wanted to say that with gnu license that you published it under -wchich is completely fine - its impossible to use this in commercial project as gnu license forces whole source of project to be publicly available.

    I think even if you use copyrighted source code you paid from asset store you would need to obey gnu license and publish even those bits of code under gnu (wchich would break the law).


    http://www.gnu.org/licenses/gpl-faq.html#GPLCommercially

    "you must make the source code available to the users of the program as described in the GPL, and they must be allowed to redistribute and modify it as described in the GPL."
     
  4. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    Well, now that Unity has released all of their engine under the personal edition, this means for Unity 5 users you no longer have to worry about supporting "non pro" features. Everything is available, so we should be able to use the full feature set of this package in the personal edition of Unity now! Time to dig out my old prototype, upgrade it to Unity 5 and see the real power of this asset :D
     
  5. Gabriella Mica

    Gabriella Mica

    Joined:
    Mar 4, 2015
    Posts:
    4
  6. monsieurbonhomme

    monsieurbonhomme

    Joined:
    Mar 9, 2015
    Posts:
    1
    Hi,
    I've got a really weird issue... I made a prototype where everything works properly then I reopened my project and lights are not rendered anymore, even if I create new one on another scene...

    I really don't understand because from my last build I changed nothing...

    Thank you !
     
  7. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
  8. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I too am not a huge fan of the license (especially for this kind of thing) but I think it's find to use if you download it from the asset store. Anything that is on the asset store is under Unity's special asset store license.
     
  9. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Call me stupid, but for the love of god I can't get this to work. Is there any tutorial how to setup your scene properly?

    Trying to get it to work with 2DToolkit Sprites and Ferr2D Terrains, but I can't figure out how exactly to setup my scene, the camera and the VLS2D Scripts...
     
  10. AMO_Noot

    AMO_Noot

    Joined:
    Aug 14, 2012
    Posts:
    433
    I don't suppose any engineer-minded folks would be interested in returning 2DVLS back to its original mesh collider detection and culling instead of the current Light Obstructors? Manually setting obstructors for every piece of tile geometry would probably kill me.

    @BTStone I believe when I had it in my project, I just took a look at how it had been set up in the example scenes.
     
  11. cc0919

    cc0919

    Joined:
    Apr 5, 2013
    Posts:
    17
    Is this working correctly with Unity 5? I downloaded the package from the GitHub, seems like it is working (sample works) but I can't for the life of me get a scene going from scratch. Tried copying everything from the sample. Anyone care to give an explanation to get a simple scene from scratch going? I'm thinking I must be missing a setting somewhere...
     
    Last edited: Apr 7, 2015
  12. Specu

    Specu

    Joined:
    Apr 17, 2015
    Posts:
    1
    Same here.
     
  13. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    :rolleyes:

    Sorry for the break but I finished QuickRopes and I am looking at returning to 2DVLS and wrapping it up again since it is so close to finished.

    The problem I have having now is that I am worried that the GPU based systems on the Asset Store are better... Anybody think 2DVLS is still worth the development time?

    As for the GitHub version and Unity 5 compatibility... I will see what I can do as far as video tutorial goes now that QuickRopes is finished.

    :(

    Jake
     
  14. SullyTheStrange

    SullyTheStrange

    Joined:
    May 17, 2013
    Posts:
    147
    I took a look at the other 2D light systems I could find and they all seem to have one flaw or another that makes it inferior to 2DVLS IMO (one has no events, two others require everything to be at the same Z position which is no good for my game, etc). I only looked for a little bit but I don't see anything I'd rather have than this. :)

    We were thinking of upgrading to Unity 5 though... 2DVLS isn't quite compatible?
     
  15. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Well that's one vote lol. Thanks! I have not looked at the other packages myself.

    It is compatible with Unity 5 but a previous poster was saying they had trouble implementing it. At its current stage it is a bit difficult to implement because the user features have not really been added ;)
     
  16. SullyTheStrange

    SullyTheStrange

    Joined:
    May 17, 2013
    Posts:
    147
    No prob! 2DVLS is great, I'll be your personal cheerleader if that's what it takes to keep it going! :D

    What user features haven't been added? I'll find out soon enough myself, we'll probably attempt an Unity 5 upgrade soon just to see how much of the game breaks.
     
  17. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    I mean the interfaces that make placing and editing different components in 2DVLS easier. Right now its a drag and drop sort of thing. Its exactly like what is in Unity 4.x (assuming you are using the GitHub version of 2DVLS).

    If you are using 2DVLS 3.x then I have no idea what will break with that to be honest. Hopefully nothing?
     
  18. mimminito

    mimminito

    Joined:
    Feb 10, 2010
    Posts:
    780
    It would be great to see this get updated and working properly again, I wanted to try and use this a little while ago with Unity 5 for an old game that I was working on, this would definitely help resurrect it!
     
  19. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    Hi I am trying to render the lights above another sorting layer, however they always appear behind it no mather which layer I choose. I tried to change the Light2D renderer's sorting layer but without luck. What would be the correct way to acheive this?
     
  20. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @mimminito I will most likely return to it. I think now that Unity allows render textures in the free version it will be much easier to support and work with.

    @Mish I think VLS2D 3.x had a bug where the sorting layers didn't work properly. Either that or it was caused by poor shaders. I should have some time this weekend to take a look at what the solution to that issue was and get back to you with the answer.

    Jake
     
  21. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    Thanks for looking into it, did you have time to find the solution?
     
  22. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
    Hi Jake,

    I'm seeing some performance issues when having multiple (active) lights. I just wanted to run something by you - my level is not that complicated and composed of polygon colliders.

    Polygons have a few hundred points so I want to try instead of doing the blind raycast (I curently do the 2000 rays one) wouldn't it be more performant to just raycast to the points of he polygon colliders? I'll most likely try this tomorrow anyway. Any issues you foresee? I'm a bit concerned with floating point inaccuracies maybe some raycasts will fail to the corners, so I may need to offset them a bit and run two of them.


    Thoughts?
     
  23. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @vividhelix - Yes! It would be more logical to only cast rays towards the points on a collider rather than doing blind raycasting. In fact the version of 2DVLS I was working on (I was calling it 4.0) did this. If you would like to try that version out then it is available on GitHub (link below). And as I posted above I would like to return and finish up 4.0!

    The problem for me was a few pitfalls that aren't considered when coming up with the solution you mentioned. It would appear to be the easier way to solve the issue but in reality it might cause more of an issue. I managed to solve most of these issues with the 4.0 beta on GitHub but never got it perfected as it relied on its own edge system that referenced 2D colliders.

    Here are some things that need to be considered:
    • A scene with 1000 lights and lets say 1000 polygon colliders with 200 points each. We only need to worry about the colliders that are visible and also predict which lights 'should' be visible and add the polygon colliders that might NOT be visible but will cast shadows in the visible lights... I used an AABB system in 4.0 to do all of this. It is buggy in the beta but I have a good idea of how to fix that when I return to it.
    • When 2 or more colliders intersect we need to find a new vertex along the intersecting edges otherwise the light gets confused and draws artifacts!
    • We need to know the bounds of our own lights so when a ray is cast towards a point and overshoots it we can tell where it should end. The way I did this in 4.0 is to make the lights themselves a 2D collider (in my own system).
    • And probably a few more things I have forgotten about by now
    So there are trade offs. The computing power it takes to calculate all of the things above might be more than you would expect and cost more in small yet simple scene. However in a very large scene the things above might not really matter at all in the grand scheme.

    Anyway, I do plan to return again and fix some of the issues in the beta and re-release it to the Asset Store. Right now I am getting QuickRopes sorted out again before I focus on another project. I am trying to keep my projects a bit more balanced so I don't get so burnt out.

    Check out the 2DVLS 4.0 Beta on GitHub here!


    Jake

    Culling System:


    VLS2D Edge System (Sorry only image I had was a bit artsy)



    VLS2D Pro Shaders
     
  24. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @Mish - Sorry no I did not but I will get to it. If it has something to do with that previous bug then it should be a very easy fix and if I can get my hands on a couple of hours I will have you a fix.

    Jake
     
  25. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
    Thanks Jake! Looking forward to version 4.
     
  26. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Just a bit of FYI. I cracked out the code last weekend. I didn't get far but I just wanted you guys to know that the seal has been broken once more ;)
     
    SullyTheStrange and vividhelix like this.
  27. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Also for sorting order issues I believe I have a solution. As I mentioned before it has been resolved in the past but the update never made it to the asset store. Unfortunatly in the time between that update and now my computer has been reformated and that update has been lost (unless I can find it in my email).

    If you wish to resolve this issue on your own, there is a variable in the renderer called sortingOrder and sortingLayerID

    Check those out to see how to resolve the sorting order.

    Jake
     
  28. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
    Yay! Any idea on a general timeline when the new package will be available? I'm asking for a non-committal date, just curious to see how to plan my development (wait a few months vs try to tackle raycast-to-collider-edge myself).
     
  29. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    No not really any time-lines. I know there are already some good products out there for 2D lights so if anybody has any suggestions on how to make it better I am open to hearing them :). I think the 2D System currently on the asset store only supports radial lights?

    Jake
     
  30. TrentSterling

    TrentSterling

    Joined:
    Jan 4, 2013
    Posts:
    99
    I bought the alternative 2D light system off the asset store, and the performance was really poor compared to 2DVLS off github. The inability to easily color and scale lights, and the way I had to make materials for different light scales drove me far away from it.

    2DVLS should definitely continue getting updates. Its the superior 2D lighting system by miles.
     
    reveriejake likes this.
  31. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Thank you!

    I will see what I can do for you guys ;)

    Jake
     
  32. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    Quick Update. I just finished rewriting the AABB check code and bounding box system. I also improved how shapes are cached and you will no longer need to use VLSObstructors as with the free GitHub version. It will automatically support standard unity colliders.

    Next up is to recreate the radial and directional light construction and then add the current shader system I have on GitHub into this one.

    Hopefully it wont take too long to wrap up. Unlike the past attempts and more like my repease of QuickRopes the initial release will not include many advanced features that may take more time to develop. The initial release will only include radial lights, directional lights, and the "Pro" shaders. Later on I will begin adding support for different light types and rendering modes like isometric.

    Jake
     
  33. GensaGames

    GensaGames

    Joined:
    May 7, 2015
    Posts:
    3
    Hi reveriejake
    Very useful material , thank you very much.



    Why shadows in my scene are sharp, how to make this smoothing effect? Or is it only available in the PRO version?

    Your the material is very useful, I think would be worth to write a little review of the opportunities for a better understanding. Once again, thank you!)
     

    Attached Files:

  34. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @GensaGames - Thanks for the compliment.

    There will no longer be a pro version of VLS2D and the next asset store update will by default contain the shaders that blur the edges since Unity free now supports render textures.

    But for now you will need to get them from me or through the GitHub VLS2D project although the GitHub version has some editor errors associated with it.

    If you wouldn't mind emailing me then I will send you the shaders sometime this weekend when I get some of those editor bugs worked out. I am at that stage right now.

    Jake
    reveriejake87@gmail.com
     
  35. Mish

    Mish

    Joined:
    Apr 23, 2010
    Posts:
    96
    Is there an approximate date for when the new version will be out on the asset store, and is it possible to get the version which uses the unity colliders before that? :)
     
  36. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @Mish I can't give out a date for the new version but I can tell you that is is for the most part finished... I am still having trouble solving a couple of issues like dealing with parented lights (scale) and rewriting the pro shader so that it is simple to use and implement.

    Unfortunately I had to go back to the "VLSObstructor" concept so you will still have to add that code to each object you want to cast a shadow. The new code will automatically reference the collider though and will not run constantly on static objects (Which should account for most of your scene). I had to go back to this because the performance took such a huge hit when dealing with 100's of colliders. I am assuming that with other systems on the asset store they are converting colliders into vertices at run-time which gets very expensive. With the VLSObstructor that only needs to be done once on static objects and anytime the object is moved while in the camera's view. This means that I could have 100's of shapes + 50 or so lights in the scene and only cause a couple of milliseconds of processing time. However if you start moving all of the shapes and lights around constantly you might hit 50ms for that number of objects ;) but if that is the case then I would like to know what type of game you are making lol.

    Anyway I will keep everyone posted when I have something to show or an update to mention!

    Jake
     
    Mish likes this.
  37. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
    Hi Jake,

    I thought you would enjoy seeing the game I'm working (using 2dvls), here's my devlog.

    Cheers,
    Radu
     
  38. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    Hey Jake,

    Can't wait for your VLS2D update! Keep up the good work!
     
  39. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @vividhelix - Looks awesome!

    @Shadeless - Yeah I can't wait to finish it lol. I am a bit stuck on some technical issues right now involving parenting. I think I will need to rewrite some of the mesh code.
     
  40. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @reveriejake I can't seem to set up VLS2D 4 on my scene no matter what I try. Any ideas? The lights and foreground just won't render and everything is dark. And I think I did everything necessary. Can you explain the setup?
     
  41. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @Shadeless - This is the GitHub version? I think there might be a bit in the GitHub version that prevents the editor from displaying all available settings. Could you send me a screenshot of what the editor windows show including the proshader editor?

    Jake
     
  42. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Woo, looking forward to the new version! I've ended up using it more than expected for the current version, so it's good to see it's still being worked on
     
  43. vividhelix

    vividhelix

    Joined:
    Mar 20, 2013
    Posts:
    78
    @reveriejake - how would I go about if I wanted to make the lights black? I'm not talking about the shadow type, I'm talking about having a vision cone and it being black/dark? Out of the box, black tint equals transparency.

    I briefly tried messing with the materials but I think I need to look at the blend type in the shader - just wondered if you thought of this and can save me some time :)
     
  44. GensaGames

    GensaGames

    Joined:
    May 7, 2015
    Posts:
    3
    Hi Jake!

    Can you find the time to share camera shaders. I manually added shader to blur the shadow, but because of this, I can not use sprites for background, because they, too, are blurred. How can I fix this?

    GensaGames@gmail.com
     
    Last edited: Jun 25, 2015
  45. Mailbot

    Mailbot

    Joined:
    Dec 18, 2012
    Posts:
    2
    Hey mikkifr!
    I'm currently getting the exact error you're describing but not really understand your fix, what exactly do you mean by manually adding entries to the VLS2D properties? I'm super confused haha

    Thanks for all your help,
    - Mailbot
     
  46. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
  47. SullyTheStrange

    SullyTheStrange

    Joined:
    May 17, 2013
    Posts:
    147
    @reveriejake, I sent an email but just in case you didn't see: we're just starting to get our game running on Wii U, and we've been running into problems with unsupported shaders. The Wii U doesn't support "fixed function" shaders, and it seems at least the 2DVLS/Light shader falls under that, meaning all 2DVLS light objects turn pink.

    We know nothing about writing shaders so it may not be possible, but is there any way it can be re-written to not be fixed function? We also had issues with several 2D Toolkit shaders but they were able to be re-written thankfully and now work perfectly. We'd really appreciate any help you could give us on this!
     
  48. GensaGames

    GensaGames

    Joined:
    May 7, 2015
    Posts:
    3
  49. Guacamolay

    Guacamolay

    Joined:
    Jun 24, 2013
    Posts:
    63
    Hi Jake, is any updates on 2DVLS? I was using the original asset store version for quite some time, but upgraded to the GitHub version a few weeks ago and I'm having some issues with meshes sometimes not detecting moving obstacles.

    I was wondering are you still working on it? Should I hold out hope :D?
     
  50. reveriejake

    reveriejake

    Joined:
    Jul 8, 2007
    Posts:
    819
    @Guacamolay - Yes actually I am working on it again and I am aware of the problems with the GitHub version :(.