From: Ingo Ruhnke Date: Sun, 2 Jul 2006 20:09:19 +0000 (+0000) Subject: - made light layer multiply instead of additive, fixed lightcone to look smooth X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=4a42359a7030eba58c6ed314eb82b05b02179d3a;p=supertux.git - made light layer multiply instead of additive, fixed lightcone to look smooth SVN-Revision: 3841 --- diff --git a/data/images/objects/lightmap_light/lightmap_light.png b/data/images/objects/lightmap_light/lightmap_light.png new file mode 100644 index 000000000..ac2a707f7 Binary files /dev/null and b/data/images/objects/lightmap_light/lightmap_light.png differ diff --git a/data/images/objects/lightmap_light/lightmap_light.sprite b/data/images/objects/lightmap_light/lightmap_light.sprite index 52d98aa2d..aa5d9cd85 100644 --- a/data/images/objects/lightmap_light/lightmap_light.sprite +++ b/data/images/objects/lightmap_light/lightmap_light.sprite @@ -1,6 +1,7 @@ (supertux-sprite (action (name "default") - (images "../../effects/light_red.png") + (images "lightmap_light.png") + (hitbox 100 100 200 200) ) ) diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 9a57bebd3..8abfdc0c4 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -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);