Afterimage shader

New releases and general discussions.

Post » Mon Oct 18, 2010 4:14 pm

I would like too see a afterimage shader. I know you can do it using events, but I think a shader would be better.
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Tue Oct 19, 2010 9:12 pm

And what does this do exactly? It would help to give a better explanation.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Tue Oct 19, 2010 9:34 pm

If you played fighting games, you'd know what they are. Anyway, basically it's a trail that mimics the sprite in a delay.

B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Oct 20, 2010 12:26 am

I don't see how a shader could do this. I'm pretty sure it's not possible.

Use a canvas instead.
-create a full layout canvas, shouldn't impact performance at all in a fighting game with a tiny layout.
-create a full screen object with erase, set it to 20% or so
-always paste the erase object into the canvas so it is constantly fading away whatever has been pasted into it.

intermittently paste the sprite when the effect is needed, the opacity of the sprite should be adjusted to 50% right before the paste, and readjusted to normal right after(the opacity tweak may not work if the paste action waits until the end of the frame, but i'm pretty sure it will work.).
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Oct 20, 2010 12:50 am

I would imagine you could do it similarly to how a motion blur effect works, just with a much slower update-rate.

Anyways, it might be also worth considering just dropping clones of the character that match the current frame and position, and then just fades out.
B
13
S
6
G
6
Posts: 144
Reputation: 3,106

Post » Wed Oct 20, 2010 1:22 am

[quote="Davioware":3mfybu23]I don't see how a shader could do this. I'm pretty sure it's not possible.

Use a canvas instead.
-create a full layout canvas, shouldn't impact performance at all in a fighting game with a tiny layout.
-create a full screen object with erase, set it to 20% or so
-always paste the erase object into the canvas so it is constantly fading away whatever has been pasted into it.

intermittently paste the sprite when the effect is needed, the opacity of the sprite should be adjusted to 50% right before the paste, and readjusted to normal right after(the opacity tweak may not work if the paste action waits until the end of the frame, but i'm pretty sure it will work.).[/quote:3mfybu23]

What about a bigger layout?
B
11
S
3
G
8
Posts: 473
Reputation: 4,569

Post » Wed Oct 20, 2010 2:22 am

[quote="buddy40":yebn7djg]I would imagine you could do it similarly to how a motion blur effect works, just with a much slower update-rate.[/quote:yebn7djg]

No.

A shader only has access to the current textures. Motion blur does not have an update-rate, thus you cannot slow it down.
Clones is the way to go.

Unless you want the trail to have the CURRENT frame of the sprite (that is, the sprite and trail change frames at the same time) in which case I remember writing a variation of motion blur that had a trail, but that's also limited to a boundary around the sprite...... short story, it's best to use clones in that case too.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Thu Oct 21, 2010 1:46 am

Anytime "No" is followed by "Unless" says quite a bit...

Anyways, I already suggested clones. Perhaps it's what he should try.
B
13
S
6
G
6
Posts: 144
Reputation: 3,106

Post » Thu Oct 21, 2010 4:28 am

What about a behavior? Would it be capable?
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Thu Oct 21, 2010 9:35 am

[quote="buddy40":1yc26i63]Anytime "No" is followed by "Unless" says quite a bit...[/quote:1yc26i63]
It says I'm willing to reconsider.

Note how I follow Unless by another no.
So.... really, no.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests