Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » faster method of multiply-blender

This thread is locked; no one can reply to it. rss feed Print
faster method of multiply-blender
Krendor
Member #6,686
December 2005

Hi,

I want to have lights in my game. I use a lightmaps
and a "ambientmap".
I draw the DoubleBuffer with

set_multiply_blender(0,0,0,255);
draw_trans_spirte(LightMap, DB, 0, 0);
draw_trans_sprite(AmbientMap, DB, 0, 0);

draw_sprite(DB, AmbientMap, 0, 0);
set_add_blender(0,0,0,255);
draw_trans_sprite(DB, LightMap, 0, 0);

In 800x600 32Bit windowed I get a framerate of 10 fps.
This is to slow for a game. Is there a faster way?

HoHo
Member #4,534
April 2004
avatar

Are those bitmaps memory bitmaps or perhaps video bitmaps?

__________
In theory, there is no difference between theory and practice. But, in practice, there is - Jan L.A. van de Snepscheut
MMORPG's...Many Men Online Role Playing Girls - Radagar
"Is Java REALLY slower? Does STL really bloat your exes? Find out with your friendly host, HoHo, and his benchmarking machine!" - Jakub Wasilewski

Krendor
Member #6,686
December 2005

The Bitmaps are Memory-Bitmaps.
But I can test the video-card for
support.

Matt Smith
Member #783
November 2000

could you use a smaller ambient map around each light?

Krendor
Member #6,686
December 2005

Yes I could.
But the Ambient-Map will be stretched over the screen.
This needs more time and the resolution is bad.

Krzysztof Kluczek
Member #4,191
January 2004
avatar

To be more precise, what you call "ambient map" is probably a flare, emissive map or both combined. :)

Quote:

In 800x600 32Bit windowed I get a framerate of 10 fps.
This is to slow for a game. Is there a faster way?

Use Direct3D, OpenGL or OpenLayer, which allows you to use hardware acceleration for such things. :)

Krendor
Member #6,686
December 2005

Oh, Sorry. I forgott to explain.
My Ambient Map is a BITMAP with the Ambient Color.
And the Light Map is a BITMAP with the Flares (etc.).

Go to: