Re: JOGL Shader Questions
Posted by
gouessej on
Mar 25, 2013; 4:49pm
URL: https://forum.jogamp.org/JOGL-Shader-Questions-tp4028783p4028799.html
bgroenks96 wrote
Your answer is, unfortunately, no longer there.... I don't know why.
My answer has been moved by the moderator, I prefer posting it anew here:
gouessej wrote
Hi
Why do you want to use glDrawPixels?
1) The role of a pixel shader consists in computing the color. What do you really want to access?
2) Yes.
3) Pixel shaders have knowledge of the screen coordinate being drawn, it should be possible, use gl_FragCoord.
4) I would rather use GLSL to perform light computations, for example per pixel lighting.
I remind you that questions specific to any JogAmp APIs including JOGL should be posted on
our official forum. Ok I will try to find a similar example using JOGL 2.0.
Edit.: Rather use GLOffscreenAutoDrawable or a simple texture mapped in a quad, it will be more reliable. glDrawPixels might not work very well with GLSL on some hardware.
Edit.2: This is
an example using GLOffscreenAutoDrawable, this is
a very simple example using GLSL.
Edit. 3: Feel free to post general OpenGL questions here of course. Sorry for the disturbance.
I advise you to read a basic course about shaders as you seem not to understand which variables are in input and in output in a shader of a particular type (vertex, pixel, geometry, ...).
bgroenks96 wrote
Unrelated, but I was trying to play your game, and JWS kept hanging on: Verifying Application...
Sometimes Java Web Start hangs on machines not fully compatible with IPV6, it's weird but it has nothing to do with my game.