This looks really great! Can I just ask, would this work in a 3d environment? I am not thinking about using this for volume light but instead as a viewcone for an npc.

Click to expand...

It kinda sorta does. The only issue with using it in a different plane is the UV mapping wasn't made to support that so it will be a bit funky. Right now the only UV mapping that is supported is x-y plane.

If you want to use this as a view cone using the Events then as long as your using an invisible view cone I don't think there would be a problem.

Well what I am thinking of using it for is an isometric stealth game with only a single height level... a little like the old Commandos games if you played that but with a 3d camera that you can pan around the characters. As long as I only have one height level then you current system should work fine right?.

If its not a big hassle for you to add support for multiple uv mapping planes then of course that would be a great addition to your product

Well what I am thinking of using it for is an isometric stealth game with only a single height level... a little like the old Commandos games if you played that but with a 3d camera that you can pan around the characters. As long as I only have one height level then you current system should work fine right?.

If its not a big hassle for you to add support for multiple uv mapping planes then of course that would be a great addition to your product

Cheers

Click to expand...

Actually its not a big hassle at all to add that type of support.

As I said, it will work for your use but the UV mapping will be kinda messy. So as long as you don't immediately expect the UV mapping to be correct then there is no problem. In the mean time I will get the UV mapping implemented in multiple axis'.

nice. do your scripts generate any runtime garbage collection? And suitable for mobile?

Click to expand...

I have not tested on Mobile but I can implement IDisposible and you can dispose of the object properly as needed. I am also putting in the feature that turns the lights off when they are not in view of the camera. Is this what you mean?

I am still kinda new to the whole usefulness and when to implement the IDisposible thing and was actually recently stumped on it during an interview . Sense I am self-taught, there are these things that I have missed because they never became an issue for me! lol

Any advice or help would be useful I want to make this as versatile as possible!

c-Row said:

Does this play nice with the likes of 2D Toolkit or SM2?

Click to expand...

It plays nicely with any sort of collider. I believe the 2D toolkit has the built in colliders so it should work no problem. I can test it out and make sure for you though.

I was wondering if this worked for Free as it doesn't seem to be explicitly stated anywhere - I would also be interested to know if it works well with 2Dtoolkit. Looks very good though and pending these answers I'll certainly pick it up for this new price!

//EDIT: Additionally I am wondering if there is any way to edit the masking style? Could it support transparency for softened edges, and what about fall off for the mask - so instead of infinitely stopping the light behind the object it would eventually ... fade back to light (surely that doesn't make as much sense as I want it to)?

Since the script is using the GL class it will not work on versions below the upcoming Unity 4 (according to the license comparison HERE) But I am working to switch from using the GL class to actually building a mesh so that it will work on free and pro versions. The update should also include some updates to performance.

If you are interested in the script and have Unity FREE please stay tuned for the next update. I will post when the update is live on this thread.

Since the script is using the GL class it will not work on versions below the upcoming Unity 4 (according to the license comparison HERE) But I am working to switch from using the GL class to actually building a mesh so that it will work on free and pro versions. The update should also include some updates to performance.

If you are interested in the script and have Unity FREE please stay tuned for the next update. I will post when the update is live on this thread.

Jake

Click to expand...

Excellent. I'll be interested in that (The version which will function in Unity Free). Will it be considered the same asset - I only ask because I'll purchase it now to support its/this further development.

It will be released as V 1.1 so yes it should be considered the same asset. If you do purchase it and find out that you can in fact use it in your version of unity please let me know! I was just going by the guidelines on the license comparison page .

Just purchased it - it works just fine on my Mac in the latest version of Unity (3.5.3f3) and I assume it will also work on my main Win machine. As a side test I also slapped it into a testbed scene with 2D Toolkit and it worked flawlessly. This is excellent stuff, I'll be playing around with it all night now.

My earlier questions about drop off and blending for the edge rendering still stand.

Cool! I am glad to hear its working on free versions of Unity . I am still going to move all the code away from the GL class though but there shouldnt be anything visually different. Just need to improve some things performance wise and allow for 3D manipulations.

@Threeli as requested by Uttpd could you let us know how the performance is. It test pretty well on my system but it would be nice to know the evaluation of other systems.(Unless of course you have a light set at full detail of (50k rays) )

PS: Performance optimizations in the future update will include switching non-visible lights off so they are not rendered.

On my MacBook Pro (I am not at home right now so I cannot test out my more powerful machine) with :

4 Separate size 100 radial lights at 600 detail interacting with 25 onscreen meshes ( of various shapes) I run at 50 FPS
I tried the same test with 300 detail instead of 600, and I was able to raise the number of onscreen meshes to 100 and the frame-rate wouldn't drop below 80.
(Even with countless physics interactions taking place) The noticeable quality between the two is minimal.

Finally I dropped the detail of each light to the default setting of 200 and was able to get 16 huge radial lights to run at 45 - 50 FPS.

When this happens :

PS: Performance optimizations in the future update will include switching non-visible lights off so they are not rendered.

Click to expand...

There should be no issue with having a huge number of lights at high detail so long as you have a reasonable number on screen.

Quick question, instead of cutting off the rays at collision to generate a void of "light" would it be possible to shoot out secondary rays to "shadow" the space behind the object. (Quick question, not such a quick concept.)

Quick question, instead of cutting off the rays at collision to generate a void of "light" would it be possible to shoot out secondary rays to "shadow" the space behind the object. (Quick question, not such a quick concept.)

Win7 Unity Free. I´m using 2dToolkit cameras. Only the one on top gets the check.
No biggie.

Also, On the first install, got a yellow error saying some conflict OS X / Win, went in to game mode and back cleaned the error and never saw it again.

Click to expand...

Okay, so it seems to be the naming convention used on the camera. If you change the name of "tk2dCamera" to "tk2dCamera_main" then it should fix your problem. I am not sure why that happens yet as I havnt looked through the code.

As for the warning message you get, its due to line endings in the code. I try to clean that stuff up before shipping but the warning can be safely ignored for the time being.

Visuals:
Can look fantastic! its pretty easy to use...but also pretty easy to...

How to make it look bad:
Take up to much screen space with too low a detail setting the 'shadows' start jumping large gaps glitching between their next previous positions, even with stationary objects. Its especially apparent on slow moving objects.

Feedback:
Currently i'd see this as a useful spot effect, but I'm hoping there will be more to this system in the future. If you have a moving zooming camera you have to be super careful with light size detail settings which impacts on the design, look time spent.

Suggestions:I want the detail setting gone completely, i'm beginning to hate that thing! I don't want to have to worry about how detailed a light needs to be to look ok - I want the lights to know how much of the screen they're taking up and adjust themselves accordingly. I should be able to have atleast some lights taking up rather more than the full size of the screen running at the same time I doubt I can do that currently with acceptable performance.

Good Luck
Unitys own lights shadows have yet to really blow me away - especially for the price, which is why I'm sticking to Unity free for now (because I doubt I could do it) why I'm very interested in your 2d solution.

You've probably come across the phrase 'painting with light'. I would like to paint with these lights so i'll be happy to help testing out new stuff you come up with I have a bunch more suggestions.

Watching how 'The Swapper' has gone from this to this is pretty inspiring.

Yeah I do plan to continue support for this. Currently its updating the lights every update but I would like to start making it so that the light only updates when an object that has the same tag as the shadow tag has entered the light radius. I hope this alone will drop the frame rate of multiple lights way down. As for the DETAIL setting. It might not be as useful once I get the above improvement done but the idea of that was for use with static lights that do not move. You could set your detail really low for directional lights and use it in the background for scene lighting without the performance needed for one with a ton of detail.

You should make the mesh update at a user-configurable rate, and rip everything out of Update entirely. Retool it to run the function at a set interval, but an adjustable one. Running on Update is probably neutering performance, when we could add so many more lights to the scene by allowing it to only update 60 or 30 (or etc.) times per second. Could gain a huge amount of performance. As it is, I can get in about 3 moving lights at an acceptable detail level before the game grinds down to about 40 FPS on my gaming PC.

These sort of performance fixes are absolutely necessary in my opinion, especially since Detail values below, say, 400, look very "chunky" when the light is in motion.

Okay the newest version of the 2d lights system is coming VERY soon. I have done some pretty significant optimizations on the system and it runs at a minimum of 2 times faster!

Here are a few optimizations that were done:
1) lights now use 1/2 to 1/3 the amount of Physics.Raycast calls
2) lights now only update when there is an object on the shadow layer within range of the light
3) lights now only update if they are on screen and visible by the camera
4) You can now specify which objects are "Static" which allows you to render the shadows on static objects without updating the mesh.

Tid-bits:
1) The new version uses the "Mesh" class and no longer uses the "GL" class.
2) UV's are fixed on the mesh when rotated in any direction
3) lights can now be infinitely deep in a hierarchy without glitching the light
4) Meshes still work when rotated for top down cases
5) The mesh detail variable is now an enumeration limiting it to 5 selections of "Low, Normal, Medium, High, Very High" mesh detail.

WARNING:
This update is an overhaul update so please expect to have to setup your scenes again. This is a trade off that had to be done in order to incorporate some of the new optimizations. Sorry for the inconvenience!

Thanks for putting out this plugin at such a good price, it's going to be really useful for my game. I do have a request though, hopefully it's an easy one. It appears that I can't instantiate lights from a prefab in runtime. It produces this error continuously:

Code (csharp):

NullReferenceException:Object reference not set to an instance of an object

Thanks for putting out this plugin at such a good price, it's going to be really useful for my game. I do have a request though, hopefully it's an easy one. It appears that I can't instantiate lights from a prefab in runtime. It produces this error continuously:

Code (csharp):

NullReferenceException:Object reference not set to an instance of an object

in your last update there is Rotate.cs which has the same name as a class inside the Playmaker package. Playmaker is already used by many, it is fine to change the name of this class for moment but if you can change it inside the next update would be best. Some other people might just see an error and dont understand how to fix it.

in your last update there is Rotate.cs which has the same name as a class inside the Playmaker package. Playmaker is already used by many, it is fine to change the name of this class for moment but if you can change it inside the next update would be best. Some other people might just see an error and dont understand how to fix it.

Playmaker and other should avoid using such common names for classes

Anyway i like your package and hope you will keep supporting it.

See ya

Click to expand...

Yeah I sometimes forget I must play nicely with others and forget that Rotate.cs might be a bit generic . I would say if your not using the sample projects then go ahead and delete the script completely.

I will push a minor update with this fix in it along with some stuff for Playmaker and uScript as I have been asked to do that as well!

Thanks for pointing it out!
Jake

PS: Would be really cool to see what some of you have done with this system via this forum. I have already been shown some really neat concepts that make use of the Event System!

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.