creating lightsources

BlitzMax Forums/BlitzMax Programming/creating lightsources

Wow, sounds cool. Thanks for explaining and sharing! I am just wondering to myself.. I don't know about the speed involved, but what about using an OpenGL stencil buffer to mask off the areas that area solid, and then just render pre-drawn light images (ie increasingly concentric circles of brightness) to the backbuffer. It will be automatically stencilled and you can draw it in LIGHTBLEND or SHADEBLEND mode to combine it with the background - and can use SetColor to select a tint color? Depending on how many lights you have on-screen and how far reaching they are, this would probably be pretty quick and easy? Only thing is it wouldn't support shadow casting. Your technique is very intriguing and I'm sure it works well, but maybe the graphics processor should be doing more of the color-combining work?

I'm not sure how you would do decent shadows with this alternative technique thought - shadows depend on the lights. I guess you could just draw `shadow objects` in appropriate places that you think would normally be shady, areas which of course will be illuminated as well by any nearby lights.