LSD Filter

I made this filter a while ago and forget about it. I dunno. maybe someone will find it useful.
The object that has the filter must also have a timer property called “timer”

uniform sampler2D bgl_RenderedTexture;

uniform float timer;


void main()
{
    float amp = 0.08;
    float turb = 20.0;
    
    vec2 texCoo = gl_TexCoord[0].st;
    float X = gl_TexCoord[0].s-0.5;
    float Y = gl_TexCoord[0].t-0.5;
    
    vec2 warp = vec2(X*(sin(timer+X*turb)*amp+0.9)+0.5,
        Y*(cos(timer+Y*turb)*amp+0.9)+0.5);
        
    vec4 warped = texture2D(bgl_RenderedTexture, warp);
    
    //****************************************************//
    
    const float contrast = 1.5;    //1 is no contrast.
    const float brightness = 1.3;    //1 is no brightness
    
    vec4 color = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
    
    color = ((color-1.0)*max(contrast,0.0));
    color = color+brightness;
    color.r += 0.05*sin(timer);
    color.g += 0.25*cos(timer);
    color.b += 0.05*cos(sin(timer));


     
    gl_FragColor = warped+color; 
}







http://i.imgur.com/XaMOd6H.gif

cool filter :smiley:

side note , is that a pancake, and if it is, he must be from a bad neighborhood.

yep its a pancake

Just when you think you’ve seen everything

Haha nice LSD filter. But an animated pancake with a gun and jetpacks, I don’t know if it’s very “moral”

Can i use this filter ? great work.

Go ahead. It’s public domain.

Cool filter!
And you can cut this filter, leaving only the color settings with brightness and contrast? Of course the values to do in the game properties.
I need this to collect objects - I picked up the object, the color and brightness temporarily changed.
Thank you!

Yep, here you go: https://blenderartists.org/forum/showthread.php?396026-Brightness-and-Contrast-Filter

Yep, and how to write parameters from the game properties, and there is no color correction?
Thanks!

To use a game property, do

uniform (float, int, &c.) prop

Color correction like hue? It’s just like Python. color = [red, gren, blue, alpha]