[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] 2D Shockwave Post Processing Filter (GLSL)



Hi all.

I am trying to implement the 2D Shockwave Post Processing Filter
(GLSL) using pyopengl.
The effect(shader) are available here
http://www.geeks3d.com/20091116/shader-library-2d-shockwave-post-processing-filter-glsl/

As far as i understood this shader is kind of post-process, so in
order to implemented it i have to do following:
- create FBO, create texture with screen size and attached it to the
FBO
- render my scene to the texture
- deactivate FBO, render texture(which included scene rendered in the
FBO) and applied shader program to this texture.

I done it(but not sure if everything is correct)

When i tried to connect everything together, i have no luck to have
Shock-wave effect.
I hope that FBO works properly, i checked with Gaussian blur, it draws
me some post-effect things but with some kind of artifact(2/3 of
screen becomes blank), but that is not relevant issue for me now, i
was using this to check if my FBO works good or not.

Returning to Shock-wave effect, i believe it has to be something with
shader, or i don't understand clearly what inputs it expects from me.

Also if i put the   "else"  condition with discard; instruction my
whole screen becomes blank, this make me think that in shader i used
the string
" if ( (distance <= (time + shockParams.z)) && (distance >= (time -
shockParams.z)) )" never returns me True, but i have no idea why.

Full code of my program can be found here
http://bpaste.net/show/13508/

I know probably my questions/mistake are ridiculous and i have to
carefully read everything related GLSL once again, but programming for
me is only hobby, i have no much time for it and have no professional
skills.
Looking forward for you help.


Cheers, Alex