Dynamic Lighting & Shadows In Blitz3d
Community Forums/Showcase/Dynamic Lighting & Shadows In Blitz3d
| ||
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. |
| ||
hm, you definitly should think about your codestyle ;) except of that, the code runs fine and the result looks good. thanks. |
| ||
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. |
| ||
Yeah, that works really nicely. Thanks for sharing the code! |
| ||
Cool stuff man. I take it this uses vertex lighting in addition to texture shadows? |
| ||
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. |
| ||
Sounds good, downloaded, I'll try it later, thanks man! |
| ||
i can't download:( |
| ||
..broken link here too.. |
| ||
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.... |
| ||
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. |
| ||
Thank you |
| ||
Wow, great effect! |