Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Shadows, horrible FPS drop

Author
Message
Gunslinger
19
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 20th Aug 2011 17:44
Hello,
i tried to use a dynamic shadow example from Sparky (i cant find the link anymore )

Is it normal that the FPS are dropping from 60 (synched/lmited!) to 30 and below?
There are 10 Objects where Shadows are casted...



(If u wonder why the Shadows are behind the player: The Lightsource is behind the Zombis somewhere)

Is there a way to create 'fast' dynamic shadows?

Thanks
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 21st Aug 2011 00:48
Shadows are always going to cause some slowdown, but there are a few things I can think of that you can do. Have you checked to see if the Shader Flag on the SET SHADOW MAPPING ON command is set to 1 rather than 0? Doing that usually speeds things up. Also, try using SYNC RATE 0 (if you aren't already) instead of 60- this will allow the program to run as fast as it can instead of being capped at a certain level. Anyway, try it out and see if anything changes


Guns, cinematics, stealth, items and more!
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 21st Aug 2011 01:16
I agree with Sixty Squares.
It's SET SHADOW SHADING ON btw.
Gunslinger
19
Years of Service
User Offline
Joined: 29th May 2007
Location:
Posted: 21st Aug 2011 13:09 Edited at: 21st Aug 2011 13:20
Yes, i shadow is on GPU (1), and synch is off. 25fps on 10 objects
I set the mesh to the map object, so the shadow is castet just on the map id, is that correct?

But doesn't help...

edit:
If the shadows are just casted from the player and the map object, its running fine. But on more objects (with enemys) its dropping down.

Is there another, faster, method for dynamic shadows?
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 21st Aug 2011 15:40
I remember in Darkbasic Clasic, came an example, that use a trick for the real time shadows. If we need shadows under our soldats, instead of set shadow shading on that drop many fps, we can make a clone of the soldat, and scale 100,0,100 . It is better to see the example


Cheers.

I'm not a grumpy grandpa
Quel
17
Years of Service
User Offline
Joined: 13th Mar 2009
Location:
Posted: 23rd Aug 2011 23:15
...oh yes the trick which tricked me into believing that DBC could handle such advanced stuff...

That, and the mighty drop menu at the top of the editor with grayed out links to various media creation tools, which i expected to be available by buying the full version. Nope, those were still nothing more but links... damn...

Anyways, that trick is fun on the thinking side, but seems a bit dated now.


My point of view on the shadow topic:

Just don't expect high speed with this many shadow casting, period. It is not DBP's fault, it is a very expensive piece of calculation. There exist bit faster solutions, especially out of DBP however. But optimization is in high demand in any case. Switch shadow off on far objects, and check the number of objects (by complexity, poly count!) already having it on so you can have a filter if the engine can take any more to be activated or not. These are games, not prerendered animations, even the most awesome AAA products have awkward popups and funny stuff going on even today.

-In.Dev.X: A unique heavy story based shoot'em ~35%
-CoreFleet: An underground commander unit based RTS ~15%
-TailsVSEggman: An Sonic themed RTS under development for idea presentation to Sega ~15%
Mugen Wizardry
User Banned
Posted: 23rd Aug 2011 23:16
Use Shaun RW's timer plugin, and combine that with a Timer Based movement variable for EVERYTHING that rotates or moves. You'll get NEAR PERFECT FPS EVERY time IF you have a decent computer!

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !

Login to post a reply

Server time is: 2026-07-11 07:05:57
Your offset time is: 2026-07-11 07:05:57