Skip to content
haedri edited this page Mar 14, 2015 · 15 revisions

Shadow Mapping with Libgdx

Introduction

In this tutorial we will see how to do some shadow mapping with Libgdx, it will cover some specific points :

  • Directional Lights
  • Point Lights
  • Multiple lights, multi-pass / forward rendering
  • It will cover shadows, not lighting techniques (colors, reflection,...)

It is best if you already have some knowledge about :

  • 3D with Libgdx
  • Shaders

I will try to do a tutorial as I like them : small "exercises" with steps and hints so that you can find the answer by yourself, and my solution after. There will be lots of “useless” steps, that are just here to help understand how things work.

This tutorial is available on:

  • Github : work repository with source code & tutorial, you can fork it to help
  • Microbasic.net : "stable" release, PDF & ZIP downloads

Table of content

Disclaimer

There are hundreds of different techniques that can be used for shadow mapping (especially when dealing with multiple lights), in this tutorial we will just see one that works with Libgdx 1.5 & Open GL 2.0, it is not the most optimized one, it's just to cover the basic and get something that works.

I am not a native english speaker, there can be some typos or badly written sentences, don't hesitate to contact me if you want to correct this tutorial (you can just fork the github wiki for example), no worries!

Versions

  • Version 1.0 : 4 parts, available on microbasic.net only
  • Version 1.1 : 4 parts, available on github, new style