Pythonstuff GLSL in English Pythonstuff GLSL auf Deutsch Pythonstuff GLSL Pythonstuff
PythonStuff Home
 

Shadow Maps with Frame Buffer Objects (FBOs) in Pyglet

Warning - this is work in progress !

This demo shows the usage of FBO (Frame Buffer Objects) with Pyglet.

At the moment this is just a rough adaption of the original C-Code from http://www.fabiensanglard.net/shadowmapping/index.php

All Kudos should go to Fabien Sanglard, who made the tutorial and the original implementation.

I just experimented a little bit with Moire-Artefacts. I think the easiest way to get rid of them is to check for the Light-to-Normal Angle. If light falls in at very shallow angles, we should not bother to query the shadow map at all - we should just

  • either say “its in shadow” and be done with it - or
  • implement (a much better) detailed surface shadow by Parallax Mapping (not implemented)

What the program does though, is a little camera movement:

  • Q = Quit
  • Space bar changes the light rotation speed: fast ⇒ slow ⇒ stop ⇒ fast
  • A,S,D,F moves the camera
  • R resets the camera

FBO Shadow Map Source Code(shadowmap.py)

Shadowmap.py Screenshot


Deutschsprachige Version, Start
Impressum & Disclaimer