(SOVLED) GL11.glPointSize() failed in 3.2

Hi everybody:
I got a problem that lwjgl.GL11.glPointSize() works fine in 3.1 but doesn’t do anything in 3.2. Can anybody teach me what to do to change point size or what have been changed in JME?
Details are :
1 to test basic game functions in a faster way I build a new mesh class tPoint witch only display a single point (still learning mesh class so there could be errors :slight_smile: ) :

import com.jme3.export.InputCapsule;
import com.jme3.export.JmeExporter;
import com.jme3.export.JmeImporter;
import com.jme3.export.OutputCapsule;
import com.jme3.math.Vector3f;
import com.jme3.scene.Mesh;
import com.jme3.scene.VertexBuffer;
import com.jme3.scene.VertexBuffer.Type;
import java.io.IOException;
import java.nio.FloatBuffer;
public class tPiont extends Mesh {
private Vector3f start;

public tPiont(Vector3f start) {
    setMode(Mode.Points);
    updateGeometry(start);
}

protected void updateGeometry(Vector3f start) {
    this.start = start;
    setBuffer(Type.Position, 3, new float[]{start.x,    start.y,    start.z});

    setBuffer(Type.TexCoord, 2, new float[]{0, 0});

    setBuffer(Type.Normal, 3, new float[]{0, 0, 1 });

    setBuffer(Type.Index, 1, new short[]{0});

    updateBound();
}

/**
 * Update the start and end points of the line.
 */
public void updatePoints(Vector3f start) {
    VertexBuffer posBuf = getBuffer(Type.Position);
    
    FloatBuffer fb = (FloatBuffer) posBuf.getData();
    fb.rewind();
    fb.put(start.x).put(start.y).put(start.z);
    
    posBuf.updateData(fb);
    
    updateBound();
}


public Vector3f getStart() {
    return start;
}

@Override
public void write(JmeExporter ex) throws IOException {
    super.write(ex);
    OutputCapsule out = ex.getCapsule(this);

    out.write(start, "startVertex", null);
}

@Override
public void read(JmeImporter im) throws IOException {
    super.read(im);
    InputCapsule in = im.getCapsule(this);

    start = (Vector3f) in.readSavable("startVertex", null);
}

}

2 I used GL11.glPointSize() to change size of these points
3 It works well in 3.1 but do nothing in 3.2 stable

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glPointSize.xhtml

I guess you have to enable it with glEnable.
Though I really recommend doing this in the shader by setting the gl_PointSize in the vertex shader.
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/gl_PointSize.xhtml

nehon :

It turns out I have to giDisable(GL_PROGRAM_POINT_SIZE) first then glPointSize works.
If glEnable(), built-in variable gl_PointSize will be used. That way glPointSize won’t work.

        glDisable(GL_PROGRAM_POINT_SIZE);
//        glEnable(GL_PROGRAM_POINT_SIZE);
        glPointSize(5f);

THANK YOU :smile:
BTW : Currently the Disable mode works fine for me, I’ll try gl_PointSize when I have time and post the result here.

Makes sense, good to know :wink:

That may not be true on all systems, especially on mobile. I’m not sure this works with opengl es.

As nehon says, point size is implementation dependant so the max size is different between drivers.