gl.glPointSize(50f) no effect?

hi everyone,

dunno why, but the glPointSize(50f) isn’t working at all… I am trying to do some Point Sprite stuff, but even the point without sprite texture remains size unchanged

anyone who have experienced this situation?

or have i got wrong understandings torwards glPointSize() ?

thx

i just tried it out…

glPointSize() should be placed outside the Begin() End() block, or no effect

always something you CANT do between glBegin and glEnd

Not much can actually be done between a glBegin and glEnd, in fact glError should report GL_INVALID_OPERATION if you call glPointSize at that point - you should always be calling glGetError at least once a frame! If you’re using LWJGL then it does this for you. If you’re using Jogl then you need to use DebugGL.

I spent nearly half an hour to figure it out ;D

thank you !

i have the same problem, i tried moving my glPointSize at various places, but my points still have a size of 1

i’m under java 1.5, with the last nightly build of jogl, and i’m pretty sure my exact same code worked just fine with a previous version of jogl (and java 1.4.2)

hi here’s a test that i do to check if glpointsize() works

the display() method of my renderer :

public void display(GLAutoDrawable drawable)
{
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glClearDepth(1);
    gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
    gl.glLoadIdentity();

    gl.glPointSize(5);

    gl.glBegin(GL.GL_POINTS);
    gl.glVertex3f(0.1f,0,0);
    gl.glVertex3f(0,0,0);
    gl.glVertex3f(0.1f,0.1f,0);
    gl.glVertex3f(0,0.1f,0);
    gl.glEnd();

    gl.glPopMatrix();
    gl.glFlush();
    Thread.yield();
}

my points have always a size of 1 pixel !!!

i’m under linux/debian
ATI 9800 with FireGL linux drivers
java 1.5
version of jogl : last night build (29/12)

i realy don’t understand, this work fine under java 1.4.2 jogl from 03/2005, have i forgotten a glEnable ?

OpenGL implementations are not required to support a point size other than 1.0. Use glGet with GL_POINT_SIZE_RANGE to find out what your graphics card supports.

Note that the GL_POINT_SIZE_RANGE limitation only applies when rendering anti-aliased points (i.e. when GL_POINT_SMOOTH is enabled, disabled by default).
The peculiar thing is that (if I understood correctly) identical code with identical drivers and hardware used to work with jogl, but does not with the jsr implementation. If that’s the case this looks like a bug. I would suggest making a little test program to reproduce the problem and file a bug report.

my GL_POINT_SIZE_RANGE is 1 (that’s odd, no ?) but i’m not using GL_POINT_SMOOTH

ok here’s a short example

the main class : (Frame.java)


package testpointsize;
import javax.swing.JFrame;

import com.sun.opengl.utils.Animator;
import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;
import java.awt.*;

public class Frame extends JFrame
{
    public final Animator animator;
    public GLCanvas canvas;
    public Frame()
    {
        GLCapabilities glCaps = new GLCapabilities();
        glCaps.setRedBits(8);
        glCaps.setGreenBits(8);
        glCaps.setBlueBits(8);
        glCaps.setAlphaBits(8);
        canvas = new GLCanvas();
        this.getContentPane().add(canvas, BorderLayout.CENTER);
        canvas.addGLEventListener(new Renderer());
        animator = new Animator(canvas);
        animator.start();
        canvas.setPreferredSize(new Dimension(800,800));
        this.pack();
        this.setVisible(true);
    }

    public static void main(String[] args)
    {
        new Frame();
    }
}

the renderer


package testpointsize;

import javax.media.opengl.GL;
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.DebugGL;


public class Renderer implements GLEventListener
{
    private GL gl;

    public void init(GLAutoDrawable drawable)
    {
        gl = drawable.getGL();
        gl.glEnable(GL.GL_DEPTH_TEST);
        drawable.setGL(new DebugGL(drawable.getGL()));
        System.out.println("Init GL is " + gl.getClass().getName());
    }

    public void display(GLAutoDrawable drawable)
    {
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glClearDepth(1);
        gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
        gl.glPushMatrix();
        gl.glLoadIdentity();

        gl.glPointSize(10);
        gl.glBegin(GL.GL_POINTS);
        gl.glVertex3f(0.1f, 0, 0);
        gl.glVertex3f(0, 0, 0);
        gl.glVertex3f(0.1f, 0.1f, 0);
        gl.glVertex3f(0, 0.1f, 0);
        gl.glEnd();

        gl.glPopMatrix();
        gl.glFlush();
        Thread.yield();
    }

    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
    {
    }

    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
    {
    }
}

the point has always a size of 1
linux/debian
ATI 9800 with FireGL linux drivers
java 1.5
version of jogl : last night build (29/12)

I just tested your example on my machine and it works fine here. Changing the point size effectively changes the size of the points on screen.
This is on Windows NT4 SP6 with the latest jsr-231 nightly build. Here’s the info I get from the OpenGL driver:
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce2 MX/AGP/SSE2
GL_VERSION: 1.3.0
I guess this points in the direction of driver issues. Maybe you could try using the software mesa renderer and see if it works using that one?

yeah, i’ll try that thanks