- Home /
Torchlight effect in 2D
My problem is quite similar to this. But I want something that's specific to Unity. Can anyone help me how to achieve this with Unity?
What I want basically is to somehow blend my glow texture and my darkness overlay.
I'm a total noob on shaders so I would really appreciate if you could give me some code snippets. I wanna be able to control the scale of the glow and its opacity.
Or if you could help me some general direction. Or hack to achieve this without using custom shaders. Thank you so much!
Answer by zee_ola05 · Feb 11, 2014 at 01:59 PM
Ok. This is what I got. Looks pretty nice for me.
So what I used is basically just the default 3D Light. But to get it to work with 2D, you have to use a Material with Sprite/Diffuse shader.
In this specific example, I used a combination of SpotLight and Point Light. That's all. If you have any questions, ask below. Vote up if it helps you! :D
Answer by EF · Feb 06, 2014 at 11:08 AM
You could create a material with Particles/Additive shader with circular gradient texture.
Answer by MaT227 · Feb 06, 2014 at 11:02 AM
I am not really sure but there are several ways to do that.
Try using light in the 2D project.
You can try using Light Cookies.
You can try using particles shader with specific blending properties with a simple quad.
There are great lighting solution on the Assetstore like this.
I suggest you to try those, but as I am not sure if I understood your need well, feel free to ask if you have any question.
Thank you for your suggestions. I will explore those. I also saw that plugin in the asset store. However, I don't want to spend $ right now.
Your answer
Follow this Question
Related Questions
shader for light replacement blending, instead of additive blending? 0 Answers
Unity 2D Shader Graph Sprite transparent when in shadow 0 Answers
Blending between arbitrary numbers of textures on the same material 0 Answers
Why Does My Scene Do This? 1 Answer
Blitting to RenderTexture does not seem to be accurate 0 Answers