- Home /
Trying to create 2D pixel art lighting
I am trying to create a pixel art game with lighting kind of like this
With points of light and a pattern of blocky but still fading away light radiating away.
So far what I have been able to do is create a Texture 2D that is the size of the screen fill it with 30% transparent black and then for each point of light replace the pixels on the texture with the pixels from my light texture (Which is just a clear circle with dark corners) The problem with this method is that if the corners of two light points meet they overlap like this
I also tried the light Projectors but unfortunately those don't work with transparency.
I only have one other idea but don't know how to implement it....
Can you write per-pixel shaders for Unity and if so, how?
Also any other solutions to this problem would be great
it's been a while you posted this, but I'm creating something similar and looking for a good solution myself. have you gotten any further with this problem??
Answer by Ash-Blue · Jul 18, 2014 at 09:04 PM
Trying to figure out something similar, Legend of Dungeon posted an interesting article on the subject http://robotloveskitty.tumblr.com/post/33164532086/legend-of-dungeon-dynamic-lighting-on-sprites
What you are really looking for probably is Sprite Lamp, but its currently under production https://www.kickstarter.com/projects/finnmorgan/sprite-lamp-dynamic-lighting-for-2d-art
So can it be done? Yes. But you'll have to figure out a slightly roundabout way at the moment.
Your answer
Follow this Question
Related Questions
Inverted Normals in Player, correct in Editor? 1 Answer
Unity 2D Lighting Effect 1 Answer
a 'bar' or neon like light. 3 Answers
[2D] Is it possible to create a collider for 2D lights? 0 Answers