Light Mapping?? If thats what you call it

BlitzMax Forums/BlitzMax Programming/Light Mapping?? If thats what you call it

MarkSponge(Posted 2006) [#1]
How would I go about creating some lighting effects like the link below, notice the light from the explosion.



Can this be done in BMax?

Mark


LarsG(Posted 2006) [#2]
sure... if you code your own 3D engine in OpenGL.. :)


Dreamora(Posted 2006) [#3]
Does not even need 3D engine.

Check the boards for fredborgs (think was him) Accum Buffer based lighting. With that you could get such effects even in 2D if you make sure that all the stuff is drawn in the correct order.

A different approach would be an "overlay image" with LightBlend / ShadeBlend / Alphablend depending on how you exactly want it to look.

The main problem is only how to get the background drawn without beeing affect by it.
The best way I could think of is:
use Indiepath Render2Texture, draw everything beside the background to that texture including the light effects. Then draw the background to backbuffer and draw that texture to backbuffer.


TartanTangerine (was Indiepath)(Posted 2006) [#4]
Or use my 2D lighting module. It uses hardware lights to achieve those types of effects. Btw, it does not support Dot3 yet but it will soon.


MarkSponge(Posted 2006) [#5]
Could I have a link to that please, can't find it.


TartanTangerine (was Indiepath)(Posted 2006) [#6]
http://modules.indiepath.com


Dreamora(Posted 2006) [#7]
Indie: Wouldn't a real light have problems with the fact that there are only 4 vertices on such an asteroid? (first thought about those as well but with few vertices, hardware lights look extremely bad)


TartanTangerine (was Indiepath)(Posted 2006) [#8]
Yes, you'd need to contstruct the image from many triangles to get a good effect or use the Dot3 Mapping.


ImaginaryHuman(Posted 2006) [#9]
Looks like you could do it with realtime bumpmapping and a shader.

You probably could also approximate it with clever use of masks and layering of light bitmaps.