PDA

View Full Version : Problem with shadows ?



programmer
18-02-2011, 09:18 AM
Hi...
I have a problem when I add shadow to my game
I tried the ShadowVolume but when I turn it to active
the speed of the game comes to be tooooooooo slow

some notes:
- I tried ZShadows but the same problem

-The map of my game is 3DS and its like a city so its has
a lot of buildings (The city in one 3DS file)

-My PC : 3000/2m , nvidia 9400 , DDR3 2G the memory

please how can I fix this problem

Andru
18-02-2011, 11:45 AM
Shadow Volume is too heavy technique, which depend on performance of CPU(I don't know if GLScene provide calculation of shadow volumes via GLSL) and require a lot of fill time. So, if your city is big, there is no way to make render faster. But if GLScene doesn't clip invisible buildings, and trying to calculate shadow volumes for them, you can try to optimize this is by clipping invisible buildings yourself.

If there is a Shadow Mapping technique in GLScene, try it instead of Shadow Volume.

programmer
20-02-2011, 02:36 PM
thank u Andru

I hope somebody find a solution for the shadows, because the shadows give more reality to the game

dazappa
20-02-2011, 08:13 PM
thank u Andru

I hope somebody find a solution for the shadows, because the shadows give more reality to the game
For this type of shadowing you really should probably look more into lightmaps and/or baking them into textures. The general idea is to pre-generate how the shadows should look while leaving few objects with actual real time shadows (such as cars, or people). You really should look into breaking up your city model into multiple models, assuming it is from a close viewpoint like first person.