Jump to content


Photo
- - - - -

Thesnidr's Grid Distortion


  • Please log in to reply
30 replies to this topic

#21 teej

teej

    The PIXEL'er

  • GMC Member
  • 840 posts
  • Version:GM8

Posted 22 March 2011 - 09:00 AM

Nice effect, it could be useful for something. :):snitch:
  • 0

#22 ninja_x

ninja_x

    GMC Member

  • GMC Member
  • 276 posts

Posted 14 April 2011 - 04:18 AM

Awesome effect! I was able to make a distorting bomb shock-wave, something I've wanted to do for a while now, by combining this with background_create_from_screen().
Views were tricky until I figured out to draw the grid at (view_xview,view_yview) and to create the explosion effect at (-view_xview,-v_yview)

One suggestion:
in eg_explode there's the line:

eg_vx[a0,i]+=(eg_dsx[a0,i]+lengthdir_x(dist,dir)-eg_dx[a0,i])/5;
eg_vy[a0,i]+=(eg_dsy[a0,i]+lengthdir_y(dist,dir)-eg_dy[a0,i])/5;
Since "5" here is effectively the damping of the effect, maybe you should include it as an argument? (The argument would stored into a variable before the loop of course, and that variable would be used in the loop rather than referring to the argument for the sake of performance, of course.)
  • 0

#23 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 14 April 2011 - 09:57 AM

(The argument would stored into a variable before the loop of course, and that variable would be used in the loop rather than referring to the argument for the sake of performance, of course.)

I think "argumentn" is going to be just as quick as "var n; n = argumentn".
  • 0

#24 ninja_x

ninja_x

    GMC Member

  • GMC Member
  • 276 posts

Posted 17 April 2011 - 07:27 AM

(The argument would stored into a variable before the loop of course, and that variable would be used in the loop rather than referring to the argument for the sake of performance, of course.)

I think "argumentn" is going to be just as quick as "var n; n = argumentn".


Oh, my bad. I always kind of assumed "argument" was slower since it was passing the value by reference every time or something, but now that I think about it I don't really know why I assumed that.
  • 0

#25 xot

xot

    media multimixer

  • Global Moderators
  • 4647 posts
  • Version:GM:Studio

Posted 17 April 2011 - 08:34 AM

In my experience, using argument is generally faster than using a temporary variable. For cases where the variable is accessed many times (in a loop, for instance) the difference can be significant. GM8.1 has made some changes to argument handling and it is possible this is no longer be the case.
  • 0

#26 vertex67

vertex67

    GMC Member

  • GMC Member
  • 512 posts

Posted 13 July 2011 - 03:58 PM

wow, this is soo much better than the first version (which i have been using in my WIP for the past year).
The velocity variables, eg_vx and eg_vy were not declared in the create script, so it threw errors until i added them, but seriously, amazing work!

btw, I was able to implement a very nice ripple effect by layering an implode on top of an explode, with the implode radius a bit smaller.
  • 0

#27 deluksic

deluksic

    GMC Member

  • GMC Member
  • 54 posts
  • Version:GM8

Posted 03 September 2011 - 10:03 PM

Realy good engine.. I see u used startx and y variables to move dots back in place, but what if u use relative position of other dots that are conected... u'd get a wave effect wich would be cooler than this... i cant use your engine cause i dont realy understand it well but u could rewrite it in this way and show us the result!
  • 0

#28 Osmium

Osmium

    Graphic Artist

  • GMC Member
  • 306 posts
  • Version:GM:Studio

Posted 07 September 2011 - 12:51 PM

Nice example! Might look a little pixelated at times but still amazing. :smile:
  • 0

#29 lolmister

lolmister

    GMC Member

  • New Member
  • 4 posts
  • Version:Mac

Posted 22 February 2012 - 06:23 PM

This looks amazing, but sadly since i have a mac I cannot use it... im just wondering what is done in the draw event. Im trying to do a similar distortion effect, but im having problems. So if I could see an example it could help clear things up for me.

Edited by lolmister, 22 February 2012 - 06:23 PM.

  • 0

#30 thecatlover1996

thecatlover1996

    GMC Member

  • GMC Member
  • 3 posts
  • Version:GM8

Posted 27 June 2012 - 08:05 PM

*bump* ^^

I was wondering if there would be a possiblity to have this distortion effect on the surface of the game itself, not just a background or a created surface.
I've tried some things, but it works quite slow and I was wondering if someone has done this already?
  • 0

#31 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 28 June 2012 - 10:14 AM

*bump* ^^

I was wondering if there would be a possiblity to have this distortion effect on the surface of the game itself, not just a background or a created surface.
I've tried some things, but it works quite slow and I was wondering if someone has done this already?


Yep. All you have to do is draw everything on to a surface instead of using the standard draw event, and use that as the distortion surface.
  • 0




1 user(s) are reading this topic

1 members, 0 guests, 0 anonymous users