Shadows

Blitz3D Forums/Blitz3D Programming/Shadows

Drey(Posted 2004) [#1]
I had some ideas on shadows, but i want to see whatelse is out there. I was thinking about doing rendering the image with no lighting or texturing(maybe have a shadow version of the model with lower poly) and replacing the light position with a camera pointing at the mesh and nothign else around it, turning that into a texture and then using some collision with the environment to place the shadow spirte down.

I can't access the internet so i'll need some conceptual stuff and process code for my friend to print it out. Sorry guys. I can still program tho :-D.

So can u help me out? thanks.


jfk EO-11110(Posted 2004) [#2]
Your Idea was already tested several times. There are some examples in the code archives. Sswift is offering a good Shadow system. All dynamic shadow systems I've seen in blitz are based on software solutions, rendering to a texture etc. You can use it if you have a limited number of Shadow Casters and lights, but as soon as you want to use it with dozens of lights and chars it may be too slow.

I tried it, fully implemeted Sswifts shadow system in my fps engine, but in the end I decided not to use it because it isn't its domain. I do now use simple heavily blurred pseudotextures, a bit like in GTA.

Sswifts system is good for things like beating up games that take place on a small stage with a low number of characters, eg. tekken-like stuff. Yu could also use his system with a single light only, eg. the sunlight. THis would still be pretty fast, even with a higher number of character.


JaviCervera(Posted 2004) [#3]
Yu could also use his system with a single light only, eg. the sunlight. THis would still be pretty fast, even with a higher number of character.
I used it for the Century town, with only one light representing the sunlight, and one character, and it was so damn slow :(

Ok, the town is something like 70.000 polys.


sswift(Posted 2004) [#4]
Ya know if people emailed me and teold me they were having problems I might be able to help you optimize the use of it, or use the data to help me optimize the system further. :-)

One thing I need to know is what is causing slowdown. It can either be rendering the shadow textueres, or it can be culling the polygons, or it can be uploading the new meshes to the 3D card. I wonder if perhaps I should create a built in profiler to tell you how much time each section takes.

In Jedive's case, sounds like the number of polygons in the level is the problem. There's two ways to fix that. Either you split your level up into multiplie entities, or I write something into the system for handling static receivers which breaks stuff up internally to speed culling.

So you see, the system's not unusable in that case. Jedive just didn't want to subdivide his level to help it out. :-)

Anyway the only thing I can't really optimize is the cost for rendering the shadows. That is just a matter of 3d cards being slow to copy from the screen to a texture buffer. But part of the reason I can't optimize that further is because I can't get enough information about animated character to avoid rendering a new shadow texture every frame.


fredborg(Posted 2004) [#5]
You can try this one: http://www.blitzbasic.com/codearcs/codearcs.php?code=1010

It sounds like it's the same as you are asking for.