Can somebody explain how opengles2 / opengl with shaders works in scummvm ?

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
kas1e
Posts: 10
Joined: Wed Jan 15, 2020 9:47 am

Can somebody explain how opengles2 / opengl with shaders works in scummvm ?

Post by kas1e »

Hi all!

Can somebody explain plz if I build ScummVM with OpenGL ES2 did it mean automatically "OpenGL with shaders" in renders? Or those things are separated?

i just build scummvm with :
#undef USE_GLEW
#define USE_OPENGL
#undef USE_OPENGL_GAME
#define USE_OPENGL_SHADERS
#define USE_GLES2

And in the "Game 3D renderer" dropdown menu has only "OpenGL with shaders" and "Software". Is "OpenGL with shaders" = "OpenGL ES2" ?
Shouldn't be there in "Game 3D render" something like "OpenGL ES 2 with shaders?

Another question is: is it anyhow better/faster to have "OpenGL with shaders" at all? I just checked myst3, grim, escape from monkey with pure OpenGL and with OpenGL with shaders and can't spot any difference not in speed, not in the look.
ccawley2011
Posts: 17
Joined: Sat Feb 03, 2018 3:45 pm

Re: Can somebody explain how opengles2 / opengl with shaders works in scummvm ?

Post by ccawley2011 »

This should summarize the purpose of the relevant defines, as I understand them. Note that the meaning of some of these have changed in recent development versions from GitHub, and might not match up 100% with current release versions.

- The USE_OPENGL define is for the 2D graphics manager, which is selectable via the "Graphics mode" drop-down. It supports detecting desktop OpenGL, OpenGL ES 1 or OpenGL ES 2 at runtime, and can be forced to use a specific runtime by compiling with --opengl-mode=any, --opengl-mode=gl, --opengl-mode=gles or --opengl-mode=gles2.
- USE_OPENGL_GAME and USE_OPENGL_SHADERS are for the 3D renderers used by ResidualVM games. The main advantage here is compatibility - the shader renderer offers compatibility with OpenGL ES 2, while the non-shader renderer offers compatibility with OpenGL 1.x without the extensions for modern shaders.
- USE_GLEW was used when using the GLEW library to link with OpenGL. It used to be required in order to use the shader renderers with desktop GL, but it's been replaced with a builtin version of GLAD in recent development versions.
- USE_GLES2 is defined in addition to USE_OPENGL_SHADERS when linking with OpenGL ES 2 for 3D games. It can still be enabled by compiling with --force-opengl-game-es2, however recent development versions with GLAD can autodetect OpenGL vs. OpenGL ES 2 at runtime, just like with the 2D graphics manager.
Post Reply