Lighting in 2D
BlitzMax Forums/BlitzMax Programming/Lighting in 2D
| ||
Hello, I'm working on a game engine and I was wanting to know if there was a way to do lighting where only parts of the sprites are color, with out having to use SetBlend to add and use a large sprite... If I need to make my own 2d engine I will is it requires multiple vertex per sprite (image) to and assign vertex colors. |
| ||
NOTHING!! COME ON!! LOL |
| ||
There is none that simple it is. Either you use pixel shaders or vertex colors You could do an overlay alpha draw but thats troublesome cause everything else behind the light geometry will be lit too (none the less thats what I do normally) |
| ||
Have you seen Rigz particle FX engine he's got lightining working in that... http://www.rigzsoft.co.uk/index.php?option=com_content&view=article&id=1&Itemid=16 Third video down shows a nice lightining style effect and he also produced a cool lighting effect for the cover of blitzmax coder .02 (see sig) |
| ||
Thats a nice system, but not what I'm looking for.. I'm looking for select lighting.. Exp: Player is half on the light and is only half lit, I have full tile lighting, but I want to only light half a tile some times. |
| ||
But you don't want to use setblend lightblend with an alpha mask, in that case you would probably either have to draw another sprite with that lighting or get down and change the values of the tiles/sprites pixels. |
| ||
Hmm.. draw all of your lights first to the backbuffer, then draw everything else in SHADEBLEND? |
| ||
hmm... that might work.. I will work on this.. |
| ||
http://www.blitzmax.com/Community/posts.php?topic=49403#550016 this?? |
| ||
That would be it, THANKS!!! |
| ||
cool. thats what im using. and that works just fine. |
| ||
I wonder what happened to TonyG. Haven't seen him in ages. (Sorry, I know that's terribly off topic but since the OP has an answer... ) |
| ||
maybe he sold his account to someone.. who knows. |