New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glVertexAttribPointer() / pgl.vertexAttribPointer() doesn't work with beta 4 #3671

Closed
dfamil opened this Issue Aug 19, 2015 · 10 comments

Comments

Projects
None yet
3 participants
@dfamil

dfamil commented Aug 19, 2015

hi

i am using kinect v2 code on windows. the shader example work fine in b3 but got a open gl function pgl.vertexAtrribPointer() error with b4

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling Aug 19, 2015

From the LowLevelGl example, it crashes on glVertexAttribPointer()
On my Mac with an intel 4000 and GeForce 650m.
Processing b4

Im getting this

com.jogamp.opengl.GLException: Caught RuntimeException: GL function glVertexAttribPointer() is not available on this hardware (or driver) Read http://wiki.processing.org/w/OpenGL_Issues for help. on thread main-Display-.macosx_nil-1-EDT-1
    at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowRepaintOp(GLAutoDrawableBase.java:214)
    at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:119)
    at com.jogamp.newt.opengl.GLWindow$2.windowRepaint(GLWindow.java:136)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3700)
    at jogamp.newt.WindowImpl.consumeEvent(WindowImpl.java:2673)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:665)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:692)
    at jogamp.newt.DisplayImpl.dispatchMessages(DisplayImpl.java:728)
    at jogamp.newt.DisplayImpl$7.run(DisplayImpl.java:657)
    at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:344)
Caused by: java.lang.RuntimeException: GL function glVertexAttribPointer() is not available on this hardware (or driver) Read

thanks
thomas

ThomasLengeling commented Aug 19, 2015

From the LowLevelGl example, it crashes on glVertexAttribPointer()
On my Mac with an intel 4000 and GeForce 650m.
Processing b4

Im getting this

com.jogamp.opengl.GLException: Caught RuntimeException: GL function glVertexAttribPointer() is not available on this hardware (or driver) Read http://wiki.processing.org/w/OpenGL_Issues for help. on thread main-Display-.macosx_nil-1-EDT-1
    at com.jogamp.opengl.GLException.newGLException(GLException.java:76)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1311)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
    at com.jogamp.newt.opengl.GLWindow.display(GLWindow.java:680)
    at jogamp.opengl.GLAutoDrawableBase.defaultWindowRepaintOp(GLAutoDrawableBase.java:214)
    at com.jogamp.newt.opengl.GLWindow.access$100(GLWindow.java:119)
    at com.jogamp.newt.opengl.GLWindow$2.windowRepaint(GLWindow.java:136)
    at jogamp.newt.WindowImpl.consumeWindowEvent(WindowImpl.java:3700)
    at jogamp.newt.WindowImpl.consumeEvent(WindowImpl.java:2673)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:665)
    at jogamp.newt.DisplayImpl.dispatchMessage(DisplayImpl.java:692)
    at jogamp.newt.DisplayImpl.dispatchMessages(DisplayImpl.java:728)
    at jogamp.newt.DisplayImpl$7.run(DisplayImpl.java:657)
    at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:344)
Caused by: java.lang.RuntimeException: GL function glVertexAttribPointer() is not available on this hardware (or driver) Read

thanks
thomas

@benfry benfry changed the title from open gl error with b4 to glVertexAttribPointer() / pgl.vertexAttribPointer() doesn't work with beta 4 Aug 19, 2015

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 20, 2015

Contributor

@ThomasLengeling Hi Thomas, between b3 and b4 we moved away from fixed function to programmable pipeline. It looks like JOGL is supporting

glVertexAttribPointer(int indx, int size, int type, boolean norm, int stride, Buffer ptr);

only in GL2 and compatibility profiles, which we are not getting anymore. I would recommend to use

glVertexAttribPointer(int indx, int size, int type, boolean norm, int stride, long offset);

instead. Here is a demo from JOGL which shows how to do it: http://jogamp.org/jogl-demos/src/demos/es2/RawGL2ES2demo.java

Contributor

JakubValtar commented Aug 20, 2015

@ThomasLengeling Hi Thomas, between b3 and b4 we moved away from fixed function to programmable pipeline. It looks like JOGL is supporting

glVertexAttribPointer(int indx, int size, int type, boolean norm, int stride, Buffer ptr);

only in GL2 and compatibility profiles, which we are not getting anymore. I would recommend to use

glVertexAttribPointer(int indx, int size, int type, boolean norm, int stride, long offset);

instead. Here is a demo from JOGL which shows how to do it: http://jogamp.org/jogl-demos/src/demos/es2/RawGL2ES2demo.java

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling commented Aug 20, 2015

Great! thanks @JakubValtar !

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 20, 2015

Contributor

@ThomasLengeling Good. Hope you won't have too many problems with it!

Contributor

JakubValtar commented Aug 20, 2015

@ThomasLengeling Good. Hope you won't have too many problems with it!

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling Aug 20, 2015

Hey @JakubValtar
I am having trouble binding the arrays with the new setup.

so I change it from

pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, vertData);

to

pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, 0);

and added the array buffer binding functions

pgl.bindBuffer(PGL.ARRAY_BUFFER, vertLoc);
pgl.bufferData(PGL.ARRAY_BUFFER, vertices.length * 4, vertData, PGL.STATIC_DRAW);

here is the complete code

https://gist.github.com/ThomasLengeling/284ded172b6e9bd56316

ThomasLengeling commented Aug 20, 2015

Hey @JakubValtar
I am having trouble binding the arrays with the new setup.

so I change it from

pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, vertData);

to

pgl.vertexAttribPointer(vertLoc, 4, PGL.FLOAT, false, 0, 0);

and added the array buffer binding functions

pgl.bindBuffer(PGL.ARRAY_BUFFER, vertLoc);
pgl.bufferData(PGL.ARRAY_BUFFER, vertices.length * 4, vertData, PGL.STATIC_DRAW);

here is the complete code

https://gist.github.com/ThomasLengeling/284ded172b6e9bd56316

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 20, 2015

Contributor

Hi @ThomasLengeling, I'll have an example for you tomorrow. We will be also removing legacy functions from PGL so I suggest to wait till tomorrow so you don't have to rebuild the library again.

Contributor

JakubValtar commented Aug 20, 2015

Hi @ThomasLengeling, I'll have an example for you tomorrow. We will be also removing legacy functions from PGL so I suggest to wait till tomorrow so you don't have to rebuild the library again.

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling commented Aug 20, 2015

great thanks!

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 21, 2015

Contributor

Hey @ThomasLengeling, I created two examples for you which should get you started https://gist.github.com/JakubValtar/b194e42dfa079a75649c

Contributor

JakubValtar commented Aug 21, 2015

Hey @ThomasLengeling, I created two examples for you which should get you started https://gist.github.com/JakubValtar/b194e42dfa079a75649c

@ThomasLengeling

This comment has been minimized.

Show comment
Hide comment
@ThomasLengeling

ThomasLengeling Aug 21, 2015

great, the examples are working!
on processing b4.

thomas

ThomasLengeling commented Aug 21, 2015

great, the examples are working!
on processing b4.

thomas

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar Aug 21, 2015

Contributor

Closing this: I removed the example and added two new ones to show how it should be done: processing/processing-docs#289
See examples: Demos/Graphics/LowLevelGLVboInterleaved and Demos/Graphics/LowLevelGLVboSeparate

Contributor

JakubValtar commented Aug 21, 2015

Closing this: I removed the example and added two new ones to show how it should be done: processing/processing-docs#289
See examples: Demos/Graphics/LowLevelGLVboInterleaved and Demos/Graphics/LowLevelGLVboSeparate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment