I’m trying to figure out how to start using GLSL with JOGL to do pixel shading on images drawn to GLAutoDrawable via glDrawPixels.
I’m confused as to how a few things work in GLSL:
- How can I access the color of the current pixel in the shader call? What is the form of that pixel (RGB, BGR, etc.) so that I can unpack it?
- Do I just assign gl_FragColor to change the pixel?
- How do I get coordinates of the current pixel?
- Does it generally make more sense to perform lighting calculations in the GLSL frag shader or maybe in OpenCL?
I’ve trying really hard to muddle through learning JOGL by myself, but I’m really stuck on these fundamental problems with GLSL, and I haven’t been able to find consistent help through Google.
Any help is appreciated, and I thank you in advance for your time.