- made light layer multiply instead of additive, fixed lightcone to look smooth
authorIngo Ruhnke <grumbel@gmx.de>
Sun, 2 Jul 2006 20:09:19 +0000 (20:09 +0000)
committerIngo Ruhnke <grumbel@gmx.de>
Sun, 2 Jul 2006 20:09:19 +0000 (20:09 +0000)
SVN-Revision: 3841

data/images/objects/lightmap_light/lightmap_light.png [new file with mode: 0644]
data/images/objects/lightmap_light/lightmap_light.sprite
src/video/drawing_context.cpp

diff --git a/data/images/objects/lightmap_light/lightmap_light.png b/data/images/objects/lightmap_light/lightmap_light.png
new file mode 100644 (file)
index 0000000..ac2a707
Binary files /dev/null and b/data/images/objects/lightmap_light/lightmap_light.png differ
index 52d98aa..aa5d9cd 100644 (file)
@@ -1,6 +1,7 @@
 (supertux-sprite
     (action
       (name "default")
-      (images "../../effects/light_red.png")
+      (images "lightmap_light.png")
+      (hitbox 100 100 200 200)
     )
 )
index 9a57beb..8abfdc0 100644 (file)
@@ -318,7 +318,7 @@ DrawingContext::do_drawing()
     glMatrixMode(GL_MODELVIEW);
     glLoadIdentity();
 
-    //glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+    // FIXME: Add ambient light support here
     glClearColor(0, 0, 0, 1);
     glClear(GL_COLOR_BUFFER_BIT);
     handle_drawing_requests(lightmap_requests);
@@ -342,8 +342,9 @@ DrawingContext::do_drawing()
   drawing_requests.clear();
 
   if(use_lightmap) {
-    glBlendFunc(GL_SRC_ALPHA, GL_ONE);
-
+    // multiple the lightmap with the framebuffer
+    glBlendFunc(GL_DST_COLOR, GL_ZERO);
+     
     glBindTexture(GL_TEXTURE_2D, lightmap->get_handle());
     glBegin(GL_QUADS);