Login  Register

Re: Enabling sampleBuffers ruins unique color selection.

Posted by Art on Feb 13, 2014; 9:31pm
URL: https://forum.jogamp.org/Enabling-sampleBuffers-ruins-unique-color-selection-tp4031453p4031577.html

I've gotten color picking to work using FSAA.  I disable the following before creating the color picking render pass.  I don't know if they are all necessary, but it works.  I haven't run into problems with colors not mapping correctly and I'm not sure if this is even a problem when rendering to textures.  Color picking works great for my framework since I render specific layers (and actors) only when necessary.  This means I can keep a color picking image around that gets tested thousands of times in a second from moving the mouse.  Another thing to keep in mind is if you are rendering in orthographic you must use integer vector points during the color picking rendering pass.

        gl.glDisable(GL.GL_MULTISAMPLE);
        gl.glDisable(GL2ES1.GL_POINT_SMOOTH);
        gl.glDisable(GL.GL_LINE_SMOOTH);
        gl.glDisable(GL2GL3.GL_POLYGON_SMOOTH);
        gl.glDisable(GL.GL_BLEND);
        gl.glDisable(GL.GL_DITHER);
        gl.glDisable(GL2ES1.GL_FOG);
        gl.glDisable(GLLightingFunc.GL_LIGHTING);
        gl.glDisable(GL2GL3.GL_TEXTURE_1D);
        gl.glDisable(GL.GL_TEXTURE_2D);
        gl.glDisable(GL2ES2.GL_TEXTURE_3D);
        gl.glShadeModel(GLLightingFunc.GL_FLAT);