I'll write a tutorial for dynamic lights and decals if Blitz3D gets more than two texture coord sets.

Blitz3D Forums/Blitz3D Programming/I'll write a tutorial for dynamic lights and decals if Blitz3D gets more than two texture coord sets.

How about this...a sort of modified "draw dynamic lights to the lightmap" approch...

Load the lightmap as a image kept in system memory (call it lightorg)...create a seperate system memory image of the same pixel size (call it lightscratch)...then create a texture that same pixel size as the lightmap (called lightmap)

Then for each dynamic light create a pivot at it's location with the same radius and use the entity visable function to deturmine if the effects of this light will show onscreen...

If so you can do all your lightmap modifications to the lightscratch image...setbuffer to the lightmap texture and draw the lightscratch image there...this should work faster then the writepixel fast method as it optimizes the system to video transfer bandwidth...writepixel is fast...but everytime you call it the video card not only needs the color, but also the location within the surface to place the color...so in effect you are sending twice the amount of data to the video card...