Fade... FX?

New releases and general discussions.

Post » Fri Apr 23, 2010 10:54 pm

A request, and a question if its even possible.
Ok so the idea for the fx is kinda like whats in this cap:
[url:34vhqwse]http://dl.dropbox.com/u/666516/fadefx.cap[/url:34vhqwse]

Basically an object with the fx would fade out in time, but the question is is it even feasible?
The cap only makes about 150 extra objects, but would doing something like that with an fx take up more resources?
I guess ideally the fx would only fade out if the object is moving, again don't know if that's possible.

Any thoughts/ takers?
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Sat Apr 24, 2010 11:34 am

Basically, what you would need is something like a one-directional blur. A pixel shader is not aware of movements, so you would need to change the strength (and therefore the length) frame by frame according to the velocity of the sprite. The problem is that pixel shader are limited in instruction slots. A loop that would create such a long tail would exceed the limit (I'd guess 4-8 instructions per iteration, max slots of shader 2.0 are 64, a for-loop would be limited to 9-16 iterations)

But maybe I'm thinking too straight forward ans someone comes up with a solution?

Anyway, as for the time consuming: I made a simple test. Your cap as provided drops from 2300 fps to 430 fps when spawning the sprites. Deactivating the spawn action and applying ZoomBlur to the layer leads to constant 592 fps - and ZoomBlur is an expensive effect. Also, you would apply such an effect to the sprite and its dimensions not to the whole layout. So I would say it would have better performance with an effect than with the spawning sprites technique.

EDIT: I'm not quite sure what you mean by 150 extra objects? When I tested your cap 1000 extra sprites where spawned at max. Or do I get it totally wrong?
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242

Post » Sat Apr 24, 2010 4:26 pm

[quote="tulamide":au5mqtgn]

EDIT: I'm not quite sure what you mean by 150 extra objects? When I tested your cap 1000 extra sprites where spawned at max. Or do I get it totally wrong?[/quote:au5mqtgn]

That's strange, guess your using unlimited framerate?
I'm using v-synced at 60 fps, and it never drops below 70 fps, and 150(ish) objects.
Its also using 4 megs of vram for the one additive fx, another reason I'm not sure if it's even a good idea.
I mean the spawning effect looks ok, other than the occasional skip. And thats really the main reason I thought an fx might be better.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Mon Apr 26, 2010 7:04 pm

You are right. For the test I switched to unlimited. That's because if I use v-synced I get exactly the monitors refresh rate and therefore would not be able to see differences.

Effects use quite a bit of the VRAM initially, but they shouldn't add. (Language difficulties here) What I mean is: Create a new empty DirectX game. Now add "Additive Plus" as layer effect and run it. It uses 4.69 MB. Now go back to construct and add some other effects. Run again and you'll see that the space required didn't change. It's still 4.69 MB.
Image
B
23
S
8
G
10
Posts: 1,820
Reputation: 8,242


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 6 guests