Identifying OpenGL/GLSL Version, Targeting a Dedicated GPU

OpenGL Version

I have been working on a volume rendering project in Processing 3.3.7 that makes extensive use of custom shaders. Everything seems to be working fine on my laptop, but there are certain features that I did not expect to be supported given my understanding of the Processing OpenGL integration, and it has left me with concerns about portability on other devices.

I have read in various places online that Processing exposes an OpenGL ES2.0 interface via JOGL. To my surprise, however, I found I am able to make use of bit-wise operators in my shader code, which I understand is not supported by the ES 2.0 shading language. This prompted me to dig a little further into the processing source, and I discovered some public constants that get set on initialization in the PGraphicsOpenGL class. Printing OPENGL_VERSION and GLSL_VERSION yields the same result:

4.4.0 - Build 21.20.16.4550

This does not look like an OpenGL ES version string. On the other hand, my shader code also uses the GL_EXT_shader_framebuffer_fetch extension, which is OpenGL ES only from what I understand. What is going on?

Dedicated GPU

I ran into another puzzling issue while digging into these constants. My laptop has an Intel 530 integrated graphics card, and and NVidia 960M dedicated GPU. Printing OPENGL_RENDERER yields:

Intel(R) HD Graphics 530

Does this mean processing isn’t using my dedicated GPU with the P3D renderer? If not, is there a way to change this configuration?

1 Like

Hi! Welcome to the forum!

for the second question, assuming windows, would manually set the GPU work? I don’t know if setting Processing’s GPU to nvidia would do it or you have to export an executable.

3 Likes

Thanks! This solves the GPU issue. Specifically, I needed to set the GPU for the java binary that ships with processing at /java/bin/java.exe.

1 Like