Normal Map Lighting in Java4K

While toying with various ideas for the Java4K game programming competition, I looked into the possibility of per-pixel lighting — using the same techniques that advanced 3D games use to give higher definition to their low-poly meshes.

The effect can be seen below. If you look closely, you will see the bricks and player being lit based on their general shape, the position, and the color of the lights in the scene.

You can see some of the code for this effect below. Be warned; as the entire program needs to fit within the confines of 4 KB, it may be a bit hard to read.

I write more about normal mapping in GLSL using LWJGL (Java + OpenGL) in the following tutorial:
GLSL Tutorial: Normal Map Lighting in 2D


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s