Login  Register

Re: JOGL Shader Questions

Posted by bgroenks96 on Mar 25, 2013; 3:06pm
URL: https://forum.jogamp.org/JOGL-Shader-Questions-tp4028783p4028795.html

Your answer is, unfortunately, no longer there.... I don't know why.

davedes said:
The "current pixel" is not known. If you want post-processing, then typically you would render the screen to an FBO texture, and then in your post shader sample from the texture in order to "get the screen pixel."

That makes sense... but I don't really know how to do it.  Does anyone know of any examples of that ^?

Why does the fact that shaders run in parallel mean the current pixel isn't known?  What can a frag shader do without knowing the pixel color?

Update:
Ok I found a pretty decent shader example here.

But what is going on with:
    uniform sampler2D fish_y_offset;
and why does it never get assigned to anything?  Does GLSL do that automatically?

I also don't really get what's happening with this:
    gl_FragColor = texture2D(fish_y_offset, gl_TexCoord[0].st);
And since texture2D is now deprecated, what's the now accepted way to do that?