Summary: | GLJPanel is not fully painted | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | Cyrille <cdefranoux> |
Component: | awt | Assignee: | Sven Gothel <sgothel> |
Status: | VERIFIED DUPLICATE | ||
Severity: | major | CC: | gouessej, sheldon+jogamp, wwalker3 |
Priority: | P3 | ||
Version: | 2 | ||
Hardware: | pc_x86_32 | ||
OS: | all | ||
Type: | --- | SCM Refs: | |
Workaround: | --- | ||
Attachments: | Test case screenshots |
Description
Cyrille
2010-07-18 10:21:09 CEST
Created attachment 147 [details]
Test case screenshots
After little investigation, I think that glReadPixels in GLJPanel.AbstractReadbackBackend.postGL() returns empty pixel information for the buggy area. But I can't understand why as everything seems fine in the glReadPixels call. On my machine, glReadPixels is called with those arguments: glFormat = GL2.GL_BGRA glType = GL_UNSIGNED_INT_8_8_8_8_REV It's only my 2 cents... On my machine, nothing is painted, it is entirely white: import java.awt.Component; import java.awt.Frame; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.media.opengl.GL; import javax.media.opengl.GL2; import javax.media.opengl.GL2ES1; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLEventListener; import javax.media.opengl.awt.GLJPanel; import javax.media.opengl.fixedfunc.GLLightingFunc; import javax.media.opengl.fixedfunc.GLMatrixFunc; import javax.media.opengl.glu.GLU; import com.jogamp.opengl.util.Animator; public class JOGLTetraHedron implements GLEventListener, KeyListener { float rotateT = 0.0f; static GLU glu = new GLU(); static GLJPanel/*GLCanvas*/canvas = new /*GLCanvas*/GLJPanel(); static Frame frame = new Frame("Jogl 3D Shape/Rotation"); static Animator animator = new Animator(canvas); public void display(GLAutoDrawable gLDrawable) { final GL2 gl = gLDrawable.getGL().getGL2(); gl.glClear(GL.GL_COLOR_BUFFER_BIT); gl.glClear(GL.GL_DEPTH_BUFFER_BIT); gl.glLoadIdentity(); gl.glTranslatef(0.0f, 0.0f, -5.0f); gl.glRotatef(rotateT, 1.0f, 0.0f, 0.0f); gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f); gl.glRotatef(rotateT, 0.0f, 0.0f, 1.0f); gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f); gl.glBegin(GL.GL_TRIANGLES); // Front gl.glColor3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(-1.0f, -1.0f, 1.0f); gl.glColor3f(0.0f, 0.0f, 0.0f); gl.glVertex3f(1.0f, -1.0f, 1.0f); // Right Side Facing Front gl.glColor3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(1.0f, -1.0f, 1.0f); gl.glColor3f(0.0f, 0.0f, 0.0f); gl.glVertex3f(0.0f, -1.0f, -1.0f); // Left Side Facing Front gl.glColor3f(0.0f, 1.0f, 1.0f); gl.glVertex3f(0.0f, 1.0f, 0.0f); gl.glColor3f(0.0f, 0.0f, 1.0f); gl.glVertex3f(0.0f, -1.0f, -1.0f); gl.glColor3f(0.0f, 0.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 1.0f); // Bottom gl.glColor3f(0.0f, 0.0f, 0.0f); gl.glVertex3f(-1.0f, -1.0f, 1.0f); gl.glColor3f(0.1f, 0.1f, 0.1f); gl.glVertex3f(1.0f, -1.0f, 1.0f); gl.glColor3f(0.2f, 0.2f, 0.2f); gl.glVertex3f(0.0f, -1.0f, -1.0f); gl.glEnd(); rotateT += 0.2f; } public void displayChanged(GLAutoDrawable gLDrawable, boolean modeChanged, boolean deviceChanged) { } public void init(GLAutoDrawable gLDrawable) { GL2 gl = gLDrawable.getGL().getGL2(); gl.glShadeModel(GLLightingFunc.GL_SMOOTH); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glClearDepth(1.0f); gl.glEnable(GL.GL_DEPTH_TEST); gl.glDepthFunc(GL.GL_LEQUAL); gl.glHint(GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); ((Component) gLDrawable).addKeyListener(this); } public void reshape(GLAutoDrawable gLDrawable, int x, int y, int width, int height) { GL2 gl = gLDrawable.getGL().getGL2(); if (height <= 0) { height = 1; } float h = (float) width / (float) height; gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION); gl.glLoadIdentity(); glu.gluPerspective(50.0f, h, 1.0, 1000.0); gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW); gl.glLoadIdentity(); } public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { exit(); } } public void keyReleased(KeyEvent e) { } public void keyTyped(KeyEvent e) { } public static void exit() { animator.stop(); frame.dispose(); System.exit(0); } public static void main(String[] args) { canvas.addGLEventListener(new JOGLTetraHedron()); frame.add(canvas); frame.setSize(640, 480); frame.setUndecorated(true); frame.setExtendedState(Frame.MAXIMIZED_BOTH); frame.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { exit(); } }); frame.setVisible(true); animator.start(); canvas.requestFocus(); } @Override public void dispose(GLAutoDrawable gLDrawable) { // do nothing } } This bug appears to be a duplicate of bug 450 (https://jogamp.org/bugzilla/show_bug.cgi?id=450). The giveaway is the fact that all pixels with x > height are black. I did a bug fix and unit test for this one, and submitted a pull request to Sven on 12/30/2010. *** This bug has been marked as a duplicate of bug 450 *** |