Dinamic Blob Shadows!

Dinamic Blob Shadows!

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Dinamic Blob Shadows!

Post 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?
Attachments
luaDinamicBlobShadows.jpg
(82.2 KiB) Downloaded 2426 times
Last edited by user on 01 Mar 2008, 18:36, edited 1 time in total.
0 x

User avatar
AF
AI Developer
Posts: 20678
Joined: 14 Sep 2004, 11:32

Re: Dinamic Blob Shadows!

Post 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
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post by user »

i will release it today, after i clean it a bit.

do you mean it should come already packed with spring?
0 x

User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: Dinamic Blob Shadows!

Post by LordMatt »

Is this faster than the engine produced shadows?
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post 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.
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post by user »

minor fixes done, packaging it now, then uploading.
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post by user »

get it here, and have fun!.
0 x

User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: Dinamic Blob Shadows!

Post by LordMatt »

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

User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Dinamic Blob Shadows!

Post 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.
0 x

User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Dinamic Blob Shadows!

Post 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...
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post by user »

no shaders here, thats why this sometimes looks weird.
0 x

User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Dinamic Blob Shadows!

Post by BlueTemplar »

Great! :-)
0 x

User avatar
Tired
Posts: 302
Joined: 14 Nov 2005, 07:19

Re: Dinamic Blob Shadows!

Post 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.
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post 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.
0 x

User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Dinamic Blob Shadows!

Post by Gota »

I wonder is spring just really so intensive cpu wise? or is it just unoptimized?
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post 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.
0 x

User avatar
Gota
Posts: 7151
Joined: 11 Jan 2008, 16:55

Re: Dinamic Blob Shadows!

Post by Gota »

So will it also lag on a quad core with a geforce 8?Since spring only supports one core.
0 x

User avatar
BlueTemplar
Posts: 314
Joined: 28 Oct 2007, 22:37

Re: Dinamic Blob Shadows!

Post 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%!
0 x

User avatar
Tired
Posts: 302
Joined: 14 Nov 2005, 07:19

Re: Dinamic Blob Shadows!

Post by Tired »

How efficient would this lua remain with, say, a 1 second delay?
0 x

user
Posts: 452
Joined: 22 Jan 2008, 16:33

Re: Dinamic Blob Shadows!

Post 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  
0 x

Post Reply

Return to “Lua Scripts”