Dynamic Lighting & Shadows In Blitz3d

Community Forums/Showcase/Dynamic Lighting & Shadows In Blitz3d

Matty(Posted 2005) [#1]
Following on from this thread:

http://www.blitzbasic.com/Community/posts.php?topic=54091

I attempted to put together a hopefully better shadow/lighting demo than what I posted in the above thread.

If you are interested then the source code is here (with sample media):

http://home.swiftdsl.com.au/~gezeder/lloyd/MoreShadows.zip

(about 300k)

Simply run the file Sci Fi Engine.bb and it should work.

All the shadow generation code is in the file shadowmap.bb

There are only a few functions required for it and it could probably be optimised. It runs at around 50fps-60fps on my laptop.

You will notice if you inspect the level meshes that I have created them in a particular manner.

There are still some graphical glitches here and there but I hope someone may find it useful. It has inspired me to get back on to working on an old project I'd left along time ago.


OJay(Posted 2005) [#2]
hm, you definitly should think about your codestyle ;)

except of that, the code runs fine and the result looks good. thanks.


Matty(Posted 2005) [#3]
Just uploaded an improved version again. Find it at the same location:

home.swiftdsl.com.au/~gezeder/lloyd/MoreShadows.zip

Here are some screenshots:








EDIT -

As of 3 hours after this post it seems my webspace is not working, well I cannot access it anyway....hopefully it will be back up soon. Oh - there are still numerous fixes that I need to implement as I am tweaking this and fiddling with it a fair amount.


BlitzSupport(Posted 2005) [#4]
Yeah, that works really nicely. Thanks for sharing the code!


Ross C(Posted 2005) [#5]
Cool stuff man. I take it this uses vertex lighting in addition to texture shadows?


Matty(Posted 2005) [#6]
Ross C - I change the color of vertices on the 'light cone' mesh to make the light appear to fade to black the further it gets from the source, rather than the level mesh which has many more vertices. I tried using a sprite parented in front of the camera but I could not figure out a way to only show a sprite for a single camera when rendering multiple camera views at once.


jfk EO-11110(Posted 2005) [#7]
Sounds good, downloaded, I'll try it later, thanks man!


Mike0101(Posted 2006) [#8]
i can't download:(


Naughty Alien(Posted 2006) [#9]
..broken link here too..


Matty(Posted 2006) [#10]
Sorry I removed it a few days ago, I will have a look for it again and put it back up if I can find it. However my email and web space is all going to change soon as I am moving house and will probably change ISP.

I will post again when it is up, or at least a similar version is up....


Matty(Posted 2006) [#11]
It is back up again. Personally I don't think it is a very good demo myself .

It may be downloaded from here:

http://home.swiftdsl.com.au/~gezeder/lloyd/MoreShadows.zip

Ignore most of the code - it is from an earlier game I put together as is most of the data. The lighting and shading technique is done in the 'shadowmap.bb' file. This system is fairly limited - basically it is best suited to a view as in the demo.

If you are still interested then discuss it with me on email (in my profile) although I'm more into 2d stuff at the moment.


Mike0101(Posted 2006) [#12]
Thank you


Foppy(Posted 2006) [#13]
Wow, great effect!