I was watching this video of a game named Chroma:
There's a very cool wave effect at 0:08 and I was wondering if this can be done in Love2D.
[SOLVED] How to do this visual effect?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
[SOLVED] How to do this visual effect?
Last edited by XHH on Wed Jul 10, 2013 11:50 am, edited 1 time in total.
I like to draw and program
Re: [Question] How to do this visual effect?
Given that löve2d has shaders, everything is possible.
This is, I suppose, some sort of post-effect or something. It would, depending on pixel position relative to wave epicenter, sample texture (already rendered plain image) from a different point, closer or further than it actually would be, thus creating a warp effect.
If you don't know what shaders are and how to use them, I really suggest studying on that first before getting to do it.
This is, I suppose, some sort of post-effect or something. It would, depending on pixel position relative to wave epicenter, sample texture (already rendered plain image) from a different point, closer or further than it actually would be, thus creating a warp effect.
If you don't know what shaders are and how to use them, I really suggest studying on that first before getting to do it.
Re: [Question] How to do this visual effect?
Instead of preaching generic and useless info I will try to get to the core.
Draw every frame to canvas, send canvas to a shader. Since Love2d doesn't provide a straight-forward access to Vertex Shader you can use the Fragment Shader called "Effect" in Love2d. In this very effect, use function called "Texel" when returning the pixel. It allows warping.
If you are a newbie that just wants the code you might get lucky cause I'm in the mood to share. Just give me some time to get my groceries
Draw every frame to canvas, send canvas to a shader. Since Love2d doesn't provide a straight-forward access to Vertex Shader you can use the Fragment Shader called "Effect" in Love2d. In this very effect, use function called "Texel" when returning the pixel. It allows warping.
If you are a newbie that just wants the code you might get lucky cause I'm in the mood to share. Just give me some time to get my groceries
Re: [Question] How to do this visual effect?
Is it really necessary to render to a Canvas? Couldn't you just apply the shader directly?
I always thought you could use the "texture Image" argument to the main function in the shader to access different parts of what you're drawing. It doesn't seem to work now when I try it though.
I always thought you could use the "texture Image" argument to the main function in the shader to access different parts of what you're drawing. It doesn't seem to work now when I try it though.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: [Question] How to do this visual effect?
No, you can't do it that way, it needs to be post-processed.
That's correct. Just keep in mind that "what you're drawing" is your plain sprite, period. Nothing more than that.I always thought you could use the "texture Image" argument to the main function in the shader to access different parts of what you're drawing.
Re: [Question] How to do this visual effect?
Oh, of course the shader is applied while you're drawing of course, not afterwards. Now everything makes sense.raidho36 wrote:No, you can't do it that way, it needs to be post-processed.
That's correct. Just keep in mind that "what you're drawing" is your plain sprite, period. Nothing more than that.I always thought you could use the "texture Image" argument to the main function in the shader to access different parts of what you're drawing.
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: [Question] How to do this visual effect?
I've done some basic stuff with shaders like inverting colors. So where can I find sample code demonstrating a warp effect?
I like to draw and program
- retrotails
- Party member
- Posts: 212
- Joined: Wed Apr 18, 2012 12:37 am
Re: [Question] How to do this visual effect?
edit: Here's my example. Use arrow keys to adjust properties.XHH wrote:I've done some basic stuff with shaders like inverting colors. So where can I find sample code demonstrating a warp effect?
Re: [Question] How to do this visual effect?
Oh cool. I haven't messed around with shaders yet, so this'll be a good example to take a look at when I do.
Re: [Question] How to do this visual effect?
Thank you so much! Can't wait to start using this!retrotails wrote:edit: Here's my example. Use arrow keys to adjust properties.
I like to draw and program
Who is online
Users browsing this forum: Bing [Bot] and 0 guests