decal lighting in blitz3d

Community Forums/Showcase/decal lighting in blitz3d

Kalisme(Posted 2007) [#1]
hmmm.... I'm not sure if this is going to work... I'd put up a link, but I have nowhere to upload it!
Oh well... I'll post the code.



now here's the cunundrem... you'll need a lightmapped *.b3d map exported from maplet.... a flashlight texture (just like the one fredborg used in his spotlight demo! http://www.blitzbasic.com/codearcs/codearcs.php?code=1000 )

(erm... hope that use of linking is ok...)
and I think that's all you really need... Though I imagine the fact I put the camera at an odd position just for my map will cause a conundrum.... just relocate it :)
I hope it works...
It's basic concept works off 3 layers...
first only the lightmap is rendered...
then the decal lights (in this case a single flashlight)
then finally the wall textures are rendered on... this third layer uses entityblend 2.
I have to say thankyou to Leadwerks (Josh) because a few years ago I Emailed him about this and he pretty much told me to do this... but at the time I didn't know much about Z buffers... then when I finnished this and looked at it I finally figured out what he was talking about, so: Thankyou very much indeed.

The controls are left, right, up, down and escape.
Best of luck.


MadJack(Posted 2007) [#2]
I wish B3d files could support a 3rd UV set...


caff_(Posted 2007) [#3]
Is it possible now we have DXTC, that 3 or even up to 8 UV sets could be allowed? Then again, asking for stuff like this seems rude if it's not used - as seems to be the case with the addition of DXTC...?


JoshK(Posted 2007) [#4]
Just render the light in an additive pass with the texture and the decal, no lightmap. I did this a long time ago in Blitz3D, and it worked great. I stored an extra copy of each face in the scene, and calculated the texcoords every frame.


jfk EO-11110(Posted 2007) [#5]
sonic - I use DXT a lot. It is of course a simple and powerfull addition to all tools that are written in blitz3D and only need to be recompiled. </offtopic>