2D Lighting

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
HazardBlu
Prole
Posts: 2
Joined: Wed Jul 31, 2013 10:37 pm
Location: Los Angeles, CA
Contact:

2D Lighting

Post by HazardBlu »

Well I want to understand how 2D lighting works in game programming. I've been searching around the web and I've seen tutorials on how to implement 2D Lighting in your game, but I need an explanation on how it works. I have also come across the word "shader", so I'm guessing that's pretty important. Can someone refer me to a good article explaining the general concept of 2D lighting. Or just explain it on the forum. :megagrin:
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: 2D Lighting

Post by T-Bone »

Well, it really depends on what you want to do. It would really help if you would clarify that, because picking the right tool for the right job is important.

I'd say most 2D games simply draw their sprites with shadows and lighting on them and just leave it like that. For more fancy effects, shaders can be used. They're simple programs that are executed while drawing each pixel on screen, allowing you to modify it. They run on the GPU, because the GPU is very good at stuff like that. If that's what you want, go and learn some basic GLSL (they are tons of guides online, just google it) and then check out http://love2d.org/wiki/PixelEffect
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests