What option i have to put Shadows in my games

Blitz3D Forums/Blitz3D Beginners Area/What option i have to put Shadows in my games

Santiworld(Posted 2008) [#1]
Hi, i have another cuestion...


what option i have to put shadows in my games...
without using external librarys.. (sorry my english)

i need option, becouse the far objetcs not need detail shadow.. but in the near objet, i won to make a nice shadow..

i use a terrain standar.... and is not flat... so the shadow must be adapted to the terrain...

thanks...


Ross C(Posted 2008) [#2]
Look for sswifts shadow system. It works very well. Even better if you optimise your levels so there's less polygons in them.


Beaker(Posted 2008) [#3]
You don't say whether you want static or dynamic shadows. You also don't say what level of detail, or what shape of objects you want to cast shadows from.

There are many ways to peel a grape.


GfK(Posted 2008) [#4]
There are many ways to peel a grape

SSwift Grape Peeler Userlib.


sswift(Posted 2008) [#5]
My shadow system can't cast shadows onto terrains made with the built in terrain functions. It can cast shadows onto a terrain made of meshes though.

Also, my grape peeler userlib comes with a free orange juicer and apple corer. It will not however assist you with your turnip garden.


puki(Posted 2008) [#6]
Hey, "sswifty", you still owe me the updated version of the Shadow System - other Blitzers have higher versions of it than me.


chwaga(Posted 2008) [#7]
???
how do you peel a grape!!?!

...I always smash mine when I try to peel them


sswift(Posted 2008) [#8]
Puki:
That's because they're better than you.

And because they EMAILED me asking for the latest version. If your version is 120, then that's the latest.


puki(Posted 2008) [#9]
I have 115.

Sniff.


Moraldi(Posted 2008) [#10]
sswift:
a) Can I build infinite terrains with your terrain system?
b) Can I cast shadows on your terrains using the Swift Shadow System?

BTW: You profile e-mail does not exist...


sswift(Posted 2008) [#11]
Um... My profile email does exist. I just looked at my profile. My email is there, and it's the right one: scswift at comcast.net

If that doesn't work for you for some reason, then try: scswift at gmail.com


Can you build infinite terrains with my terrain system?

As is? No.

Could you modify it to?

I don't see why not. It generates a grid of meshes from a heightmap you specify, with multiple levels of detail, and stores them in an array. You'd have to make the array indexing wrap or something and move the meshes as needed.

Can you cast shadows onto it?

Ah, well, technically the answer is yes.

But it will require some more work on your part to do that, because each tile has multiple levels of detail. What you'll want to do is turn on shadow casting for the tiles which are nearest the player, for the highest detail level. That'll require you to delve into the terrain system to find the mesh pointers in the array though. You wouldn't want all the highest detail tiles to be turned on at once cause it would be too slow. And you also don't want to turn off and back on the tiles over and over each frame cause the shadow system caches the mesh data, so you'll want to keep track of which tiles are currently casting shadows and which aren't so you can set and reset only those ones the player can't see.

It's hard to have a shadow and/or terrain system simply be plug and play and get the most out of it.


Moraldi(Posted 2008) [#12]
Thanks for your info :)
I need something to work with immediately without making modifications of my own..


sswift(Posted 2008) [#13]
I'm just gonna reply to your email here since I don't use my gmail account much, it just gets forwarded to my email address and I don't know that you'll receive a reply from the comcast address.

Maybe you have signatures turned off on the forum, because I have a link to the demo and information in mine, but there's lots of information about my terrain system and a link to the demo in my worklog here:

http://www.blitzbasic.com/logs/userlog.php?user=963&log=1201

That should answer the questions you asked me in your email.

I can't promise you you won't have to make any modifications to it, but it works. It's just not designed to work directly with the shadow system, and like the blitz terrain system it has certain limitations. Mine allows you to use many different textures and use very high detail terrains, but it comes at the cost of video ram for the mesh storage, and it requires you to be more clever about how you handle terrain collisions, and you need to access a few arrays to cast shadows onto it. Oh, and it's possible to see cracks between the tiles if you have the lower detail levels too close to the camera. But at least you're not stuck with one terrain texture, low detail terrains, and no shadows on terrains at all.


Moraldi(Posted 2008) [#14]
Thanks.
I'll have to check all possible solutions for me


jfk EO-11110(Posted 2008) [#15]
That would be pretty good, a LOD system for Shawns Shadow Lib. As far as I see this isn't supported yet. Eg. 3 levels: near, casted, midrange static, far blob, very far none.