GMLscripts.com

Discuss and collaborate on GML scripts
Invert

You are not logged in.

#1 2007-10-25 13:32:56

Schreib
Member
Registered: 2007-10-12
Posts: 11

Graphic effect "trail o' blur"

Hi everyone,

I'm trying to make a trail effect for a glowing projectile I have. The trail effect should be a spinning "spiral" of blurred, slightly additive blue streams, that fade out after time. They shouldn't move, but rather statically look like shaped in a spiral, and fade / blur out over time. Here's a picture someone on the 64digit site made:

movingvd2.jpg

I'd like to achieve a similar effect, but in GM of course, and real-time. Any ideas on how that be done? I have to my disposal possibly one small surface.

Offline

#2 2007-10-25 16:51:29

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: Graphic effect "trail o' blur"

How big does this effect have to be, bounding box size?

How many times does this need to appear on screen?

How big is "one small surface"?

Are you using views? Does the screen need to be able to scroll?


Abusing forum power since 1986.

Offline

#3 2007-10-25 17:22:44

Schreib
Member
Registered: 2007-10-12
Posts: 11

Re: Graphic effect "trail o' blur"

This effect will not cover more than the screen, so I definately don't need a surface that big. Let's say it would be (the bounding box) 300x300 or 400x400. I use views, and the screen scrolls automatically. With "one small surface" I meant that the resolution of the effect doesn't need to be really big; therefore I can use a smaller surface and then scale it up. This is a trail effect to a projectile, so when the projectile is destroyed, the effect will fade away and then be "destroyed". It doesn't need to be updated EVERY step, but the more, the merrier. smile I hope I answered your questions. Sorry for being unspecific.

Offline

#4 2007-10-25 21:17:59

Yourself
Member
Registered: 2007-10-09
Posts: 48

Re: Graphic effect "trail o' blur"

This effect will not cover more than the screen

Technically speaking no effect can cover more than the screen.  tongue

Offline

#5 2007-10-26 06:01:47

Schreib
Member
Registered: 2007-10-12
Posts: 11

Re: Graphic effect "trail o' blur"

Hehe, true. I was thinking of using the technique xot uses to blur in his fire, would this work? If I could get the effect I showed in the picture that would be really great. Perhaps I need to make a sprite effect to draw on some surface, and then blur that. Any other ideas?

Last edited by Schreib (2007-10-26 06:02:36)

Offline

#6 2007-10-26 13:24:43

paul23
Member
Registered: 2007-10-17
Posts: 110

Re: Graphic effect "trail o' blur"

Yourself wrote:

This effect will not cover more than the screen

Technically speaking no effect can cover more than the screen.  tongue

well with the new "ambiance tv" it is technically possible now tongue - I love to bring up pointless counter arguments >_<

Offline

#7 2007-10-26 14:20:48

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: Graphic effect "trail o' blur"

Schreib wrote:

Hehe, true. I was thinking of using the technique xot uses to blur in his fire, would this work? If I could get the effect I showed in the picture that would be really great. Perhaps I need to make a sprite effect to draw on some surface, and then blur that. Any other ideas?

That was the approach I was thinking of. The scrolling complicates things, as does the limitation of one surface. I could see one small surface per projectile (you didn't say how many projectiles at a time). If the image in the surface scrolls at the same speed the projectile moves, and the surface follows the projectile, then you could use a small surface per projectile. I think thats the only way to address all of the limitations. I'd make it a separate object that follows the projectile, when the projectile is destroyed, set an alarm in the effect so that it is destroyed in (size / speed) steps.

The basis for the effect I'd draw it on the right edge, in the vertical middle, and scroll everything to the left. Then when it comes to drawing the surface, use the d3d_transform functions to position and rotate it the surface where you need it. You'll probably want to draw it with additive blending. Drawing the effect as a spiral would be something along the lines of drawing a small sprite each step to the surface, offsetting y with a sine function, or offseting both x and y with lengthdir_*() in a circular pattern, advancing the angle of the offset each step. You also might want to vary the amplitude of the offset (probably using another sine function) to get a more interesting looking effect.

Scrolling/fading would be very similar to the fire effect I posted here. Maybe draw the surface to itself with low alpha at (x-1,0); (x-1,-1); (x-1,1).

I'm not at my Game Maker computer, so I can't try any of this out right now.


Abusing forum power since 1986.

Offline

#8 2008-12-14 12:45:53

Gmgex
Member
Registered: 2008-11-30
Posts: 5

Re: Graphic effect "trail o' blur"

i saw an example before like that but it might not be 100% what you want...
oh here i found it!

made by GearGod

Download

Last edited by Gmgex (2008-12-14 12:46:49)

Offline

#9 2008-12-14 15:56:35

xot
Administrator
Registered: 2007-08-18
Posts: 1,239

Re: Graphic effect "trail o' blur"

Thanks for that, but this topic is over a year old. I believe Schreib has solved this problem already, with help from GearGOD if I remember correctly.


Abusing forum power since 1986.

Offline

Board footer

Powered by FluxBB