thanks to Gile[s]!
I think I found a way to give the illusion of multiple lights in a level while useing only one hardware light...it's a trick basied on what id software did for the first Quake game...
You would need a level that uses lightmaps for "lighting" a level (second set of U,V cords for the lightmap, etc..)
I discovered this while playing around with Gile[s] trying to get surfaces to act as light sources (great program, BTW)...dunno if others have figured it out yet...but I'll post this anyway to give you all some ideas...
You need a game level with lightmaps, and one hardware light (just a directional one to shine light down onto your entities)...
basicly for each entity in the level you do a linepick strait down to the level mesh, get the triangle and calculate the pixel cords for the lightmap texture (use second set of U,V cords)...then find the color of the lightmap pixel at those cords...then entitycolor the entity with that color!
This will seemingly change the light color and intensity of the entity...a dark lightmap value will make the entity seem in shadow...a bright red lightmap value would make it look like it was in light with a red light...a full on white entitycolor value would make it look "normal"...this works because by default entities are full white and textures are rendered with the multiply flag by default (meaning that the texture acts sorta like a lightmap on the entity by default)...I don't own Blitz3D yet (come on X-Mas money!), but playing around with the demo and a "find texture cords" routine here, shows that it could work out nicely I think...not truely accurite, but should work for most things...
to speed things up when loading the game level, copy the lightmap to a bank or array, this way you can get the lightmap values without locking the texture and readpixel fast...which would be slower then a simple look up in an array or bank...
Hope this helps, and sorry if this was pointed out earlyer.
I think I found a way to give the illusion of multiple lights in a level while useing only one hardware light...it's a trick basied on what id software did for the first Quake game...
You would need a level that uses lightmaps for "lighting" a level (second set of U,V cords for the lightmap, etc..)
I discovered this while playing around with Gile[s] trying to get surfaces to act as light sources (great program, BTW)...dunno if others have figured it out yet...but I'll post this anyway to give you all some ideas...
You need a game level with lightmaps, and one hardware light (just a directional one to shine light down onto your entities)...
basicly for each entity in the level you do a linepick strait down to the level mesh, get the triangle and calculate the pixel cords for the lightmap texture (use second set of U,V cords)...then find the color of the lightmap pixel at those cords...then entitycolor the entity with that color!
This will seemingly change the light color and intensity of the entity...a dark lightmap value will make the entity seem in shadow...a bright red lightmap value would make it look like it was in light with a red light...a full on white entitycolor value would make it look "normal"...this works because by default entities are full white and textures are rendered with the multiply flag by default (meaning that the texture acts sorta like a lightmap on the entity by default)...I don't own Blitz3D yet (come on X-Mas money!), but playing around with the demo and a "find texture cords" routine here, shows that it could work out nicely I think...not truely accurite, but should work for most things...
to speed things up when loading the game level, copy the lightmap to a bank or array, this way you can get the lightmap values without locking the texture and readpixel fast...which would be slower then a simple look up in an array or bank...
Hope this helps, and sorry if this was pointed out earlyer.