Page 1 of 3

Dinamic Blob Shadows!

Posted: 01 Mar 2008, 15:47
by user
you might be thinking what the , well, i will explain:

Image

they are projected by the sun, scale around the units, move away when the unit is flying, 20 to 30 times faster than normal shadows.

if you scroll down you will see the link:
get it here, and have fun!.
argh, this is what you were trying to make a while ago?, right?

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 16:09
by AF
Ideally this should be in the engine either as a default widget or using some new interface for 'engine gadgets' that show up in settings.exe

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 16:49
by user
i will release it today, after i clean it a bit.

do you mean it should come already packed with spring?

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 17:52
by LordMatt
Is this faster than the engine produced shadows?

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 18:02
by user
way faster, i get few fps with normal shadows even at very small shadow maps, while with this, i am always at good frame rates.

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 18:23
by user
minor fixes done, packaging it now, then uploading.

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 18:33
by user
get it here, and have fun!.

Re: Dinamic Blob Shadows!

Posted: 01 Mar 2008, 19:42
by LordMatt
Maybe this could get turned on by the FPS widget when normal shadows have to be turned off to keep FPS acceptable.

Re: Dinamic Blob Shadows!

Posted: 02 Mar 2008, 20:03
by Argh
Excellent! I'd like to add that Widget to World Builder, I think people will really want to use that, if they have slower computers, but I want to see what it does with buildings and different sun angles first.

Maybe this could get turned on by the FPS widget when normal shadows have to be turned off to keep FPS acceptable.

Yeah, that'd be easy to add, just send an Echo.Spring("/shadows 0") I think... I'll try that when I get home tonight.

Re: Dinamic Blob Shadows!

Posted: 02 Mar 2008, 20:43
by BlueTemplar
Does it work if your GPU doesn't support Shaders 2.0? Otherwise "People with slower computers" might not see a lot of benefit...

Re: Dinamic Blob Shadows!

Posted: 02 Mar 2008, 22:53
by user
no shaders here, thats why this sometimes looks weird.

Re: Dinamic Blob Shadows!

Posted: 02 Mar 2008, 22:56
by BlueTemplar
Great! :-)

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 13:59
by Tired
Not that I'm complaining, but there's a slight delay between zooming in on a unit and the appearance of shadows (worst case with no lag up to 3 seconds). I've seem similar (much worse) delays in CA nanoturret effects. Is this a symptom of lua callins, or necessary for efficiency?

Nice widget.

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 15:58
by user
all the get units functions are very CPU intensive, when using them per frame, i lag down to around 6 FPS.

this uses a 2 second delay to get the units, CA probably uses a 3 second delay.

this is much faster than normal shadows, sometimes when i am at around 50 FPS, if i turn this on, only lags when a bunch of units are on view.

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 16:31
by Gota
I wonder is spring just really so intensive cpu wise? or is it just unoptimized?

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 16:56
by user
it is unoptimized, even at extreme low settings, very low unit limit, very small maps, playing the classic TA mod, you will lag a lot later in the game.

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 18:14
by Gota
So will it also lag on a quad core with a geforce 8?Since spring only supports one core.

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 19:25
by BlueTemplar
It must be unoptimised... it's not normal that I have most of the time Interface Draw using 80% (50-70% without luaui), while Draw World uses only 30%!

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 21:16
by Tired
How efficient would this lua remain with, say, a 1 second delay?

Re: Dinamic Blob Shadows!

Posted: 03 Mar 2008, 22:14
by user
on a very good computer this widget mostly won't lag, while spring will lag like _, its not that spring supports only one core, it does supports multi cores, but its very limited, some people will lag a lot, others won't.

yes, it is very unoptimized, but the problem, is that nobody has the time , and nobody wants to fix it.

at one second update rate, lag would increase, but not alot, to change it to one second, replace:

Code: Select all

function widget:Update()
  if (Spring.GetGameFrame() % 60 < 1) then  

with:

Code: Select all

function widget:Update()
  if (Spring.GetGameFrame() % 30 < 1) then