Ripple shader

  ... discussions regarding GLES2 ShaderPrograms (VertexShaders and FragmentShaders).

Re: Ripple shader

Postby mrfarts » Mon Mar 25, 2013 4:46 pm

cr_az wrote:I got a set of questions about this sample code. IMO, it would be better to share code with you guys.

Here is a archive with sources - https://www.dropbox.com/s/kl5ih45sf7f8nrm/LW_ripple.zip
Code is not for production (code style and related thing are far away from being perfect), I wrote it as a part of shader investigation - just to check how to use shaders with AndEngine.

Enjoy.


Thanks for making this out,was looking for a working example for andengine thanks :) Well may i ask how i can get more than one ripple when every time i touch the screen.now i have to wait while active one is 0.thanks in advance and thanks for everything
Image
mrfarts
 
Posts: 135
Joined: Fri Jan 25, 2013 6:14 pm

Re: Ripple shader

Postby unbeatsoft » Mon Apr 15, 2013 6:18 pm

How to do this for one sprite? How get gl_FragCoord for ine sprite?
unbeatsoft
 
Posts: 4
Joined: Sun Mar 17, 2013 12:37 pm

Re: Ripple shader

Postby nkarasch » Wed May 15, 2013 3:07 pm

unbeatsoft wrote:How to do this for one sprite? How get gl_FragCoord for ine sprite?


I'm also trying to figure this out. Thanks for the example, it is greatly appreciated.
nkarasch
 
Posts: 9
Joined: Mon May 06, 2013 2:32 am

Re: Ripple shader

Postby mrfarts » Mon Nov 25, 2013 5:13 pm

I did got the ripple inside the live wallpaper but when i set the live wallpaper or get to settings and back in preview.I got the background image flipped..why is that? Also there is a small black dot where the ripple origins. do anybody know why that happens?
Image
mrfarts
 
Posts: 135
Joined: Fri Jan 25, 2013 6:14 pm

Re: Ripple shader

Postby alb » Mon Nov 25, 2013 5:36 pm

I once made a ripple shader for an app and got a black spot at the centre too. I think it was something to do with dividing by zero in the fragment shader. I haven't looked at the source code for this project but it might be the same problem.

I've no idea why the image might be flipped, sorry.
alb
 
Posts: 134
Joined: Tue Jan 29, 2013 10:45 pm

Re: Ripple shader

Postby cr_az » Mon Dec 02, 2013 12:24 am

Regarding flipped image, as far as I remember, there was an issue with AndEngine or my test code.

I can`t remember why I was unable to fix it, but flipped image should be related to following code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. // rotate the Bitmap, AndEngine will map it vice versa
  2.  
  3.                 final int iRotateAngle = 180;
  4.                 matrix.postRotate(iRotateAngle);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4
cr_az
 
Posts: 17
Joined: Sat Dec 24, 2011 8:03 pm
Location: Ukraine

Re: Ripple shader

Postby mrfarts » Mon Dec 02, 2013 5:44 am

cr_az wrote:Regarding flipped image, as far as I remember, there was an issue with AndEngine or my test code.

I can`t remember why I was unable to fix it, but flipped image should be related to following code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. // rotate the Bitmap, AndEngine will map it vice versa
  2.  
  3.                 final int iRotateAngle = 180;
  4.                 matrix.postRotate(iRotateAngle);
Parsed in 0.010 seconds, using GeSHi 1.0.8.4


it was not just a flipping, i am using it in my live wallpaper and the ratio of the image is messedup when got flipped. like height of the image is shrinked inside the screen..which is not a good result. I had started using libgdx because of this.
Image
mrfarts
 
Posts: 135
Joined: Fri Jan 25, 2013 6:14 pm

Previous

Return to ShaderPrograms

Who is online

Users browsing this forum: No registered users and 2 guests