Lighting Basics

Can someone explain how lighting works? I’ve been programming in java for about a year. But I’m relatively new to game programming so i have no idea how people achieve thows cool effects in their applications. I’m looking for a broad definition focused on 2d games. And some vocabulary. Shaders, Static, and Dynamic Light. What does all that mean. I’m familiar with the Java 2D API. Do i need something else like OpenGl. Just looking for some lighting 101 :slight_smile:

Well, if you look at the JGO wiki or the Articles board, you’ll find a good bit; here’s one page on dynamic 2D lighting, which is probably what you’re thinking of most: http://www.java-gaming.org/topics/2d-dynamic-lighting/27012/view.html

If your just getting into OpenGL. Don’t learn the fixed function pipeline. (glBegin() and glEnd()). Get a REALLY firm grasp on the openGL programmable pipline, then get into GLSL shaders, and such. But for now, the best option is to get extreamly familiar with OpenGL and its programmable pipline. (Preferably OpenGL 1.2-1.5) then to 3.0 then to 4.0.

Heres some good tutorials; Read all of them over until you get it completely, seriously, amazing stuff here. http://www.opengl-tutorial.org/

As for lighting, GLSL is the way to go. You may need to learn FBOs to generate real-time light maps too.

It depends on what kind of lighting method he is going to use. I suggest forward rendering, just because it’s the most simple to begin with. With both dimensions and forward rendering, you don’t need FBOs whatsoever, just a simple shader for each kind of light (directional, point, spot to name a few) will do the trick. However, if he’s programming a deferred renderer he will need FBOs for the normal, depth, and diffuse (color) buffer as well as another one which is generally optional for a simple system.