- Home /
point lights too many drawcalls mobile 2d game
I noticed that when i have point lights in a 2d game, I get +2 draw calls or something for each light per each sprite which adds up to 100-1000's of draw calls very quick if i have something like 20 point lights and 20 sprites.
Is there absolutely no way around this? no way to render the sprites differently or some kind of tricks to make this work?
The reason is because my game has a flamethrower particle system and zombies that can be set on fire so each zombie on fire has to have its own light and the flamethrower itself has around 15 lights at full blast to give the illusion that the particles give off light,
It all looks very pretty and vibrant especially with a shimmering effect that you cant tell from the screenshot... but it also causes 100-1000's of drawcalls which obviously kills frame rate on mobile.
I just don't see any other way i can provide a vibrant light for each burning zombie other than using an actual light source.
Is there no way to fake this glow effect on Unity Free? I know there's a glow package in the asset store but it requires unity pro.
It doesn't need to be perfect! I just want a fiery glowing effect like in the screenshot.
is there perhaps a free 2D sprite lightmap plugin or something that would work?
It seems like you're already using particle systems, but isn't it an idea to make a glow using a ParticleSystem? I've done this in the past and it worked quite neat. Just make sure the sprite/texture used for the glow looks something like this: and make sure to save it as a '.tif' for the best result. Also, had the issue with the lights one time for mobile, and your best shot is to $$anonymous$$imize the quality settings for your game. Hope this helps!
yea i was actually thinking about making semi transparent particles behind the main fire particles that would look like a glowing effect.
I'd be more than happy to use the one you provided :)
One question though out of curiosity. Why would .tif provide the best result? I thought .png format was the best one to use, tif is really just an image container type thing.
Unless you'd want to save layers and/or a higher bit depth than 8888, PNG would do fine. In any case, any texture format you feed to the engine, it will get converted and packed to the texture format you have set in the player settings/texture import. (ETC, DXT, PVR, ATC etc.)
Answer by luniac · Sep 06, 2014 at 05:06 PM
Hey it worked Malfegor! I had my photoshop friend modify the image you supplied to white since he couldn't easily make the black background transparent because of the gradient, and the result in game looks pretty dam good! I could even recreate my scripted flickering effect i had before by playing around with emission and lifetime values! I used .png to save space for mobiles.
Thank you!
The modified version is attached below if anyone needs it as well :) It's invisible in the viewer because of the transparency stuffs.
Really glad it worked out for you! As for the curiosity thing: I'm not really much of an Artist myself, but a professional once told me .tif gives beter results, if you're looking for a particle texture; especially when you're going for a transparent particle. Good luck with the rest of the project!
Hello. I am trying to achieve the same effect in a simple 2d game for mobile to make lighting imitation. Could you please tell what settings did you use on your hallow.png sprite or texture? Which shader? What should i do to get a similar effect?