AmigaOS4 OpenGLES

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

Moderator: ScummVM Team

User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

AmigaOS4 OpenGLES

Post by Raziel »

Hi guys,

trying to build residualvm with opengles support, but ran into some problems.

./configure -enable-static --enable-opengl-shaders --force-opengles2

config.log

Code: Select all

#include <GL/gl.h>
int main(void) { return GL_ES_VERSION_2_0; }

g++ -athread=native -Wl,--no-keep-memory -L/sdk/local/newlib/lib -Wl,--export-dynamic -L/sdk/local/newlib/lib --std=gnu++11  -gstabs -W -Wno-unused-parameter -Wno-empty-body -pedantic
-Wno-long-long -Wno-format ./residualvm-conf.cpp -o ./residualvm-conf -DPPC_TARGET -DSDL_BACKEND
./residualvm-conf.cpp: In function 'int main()':
./residualvm-conf.cpp:2:25: error: 'GL_ES_VERSION_2_0' was not declared in this scope
 int main(void) { return GL_ES_VERSION_2_0; }
                         ^~~~~~~~~~~~~~~~~
./residualvm-conf.cpp:2:25: note: suggested alternative: 'GLU_VERSION_1_2'
 int main(void) { return GL_ES_VERSION_2_0; }
                         ^~~~~~~~~~~~~~~~~
                         GLU_VERSION_1_2
return code: 1


#include <OpenGL/gl.h>
int main(void) { return GL_ES_VERSION_2_0; }

g++ -athread=native -Wl,--no-keep-memory -L/sdk/local/newlib/lib -Wl,--export-dynamic -L/sdk/local/newlib/lib --std=gnu++11  -gstabs -W -Wno-unused-parameter -Wno-empty-body -pedantic
-Wno-long-long -Wno-format ./residualvm-conf.cpp -o ./residualvm-conf -DPPC_TARGET -DSDL_BACKEND
./residualvm-conf.cpp:1:10: fatal error: OpenGL/gl.h: No such file or directory
 #include <OpenGL/gl.h>
          ^~~~~~~~~~~~~
compilation terminated.
return code: 1


#include <GLES2/gl2.h>
int main(void) { return GL_ES_VERSION_2_0; }

g++ -athread=native -Wl,--no-keep-memory -L/sdk/local/newlib/lib -Wl,--export-dynamic -L/sdk/local/newlib/lib --std=gnu++11  -gstabs -W -Wno-unused-parameter -Wno-empty-body -pedantic
-Wno-long-long -Wno-format ./residualvm-conf.cpp -o ./residualvm-conf -DPPC_TARGET -DSDL_BACKEND
return code: 0
It does build with this missing OpenGL, i get this at start

Code: Select all

User picked target 'grim-win' (gameid 'grim')...
  Looking for a plugin supporting this gameid... Grim Engine
  Starting 'Grim Fandango'
INFO: TinyGL front buffer pixel format: RGB565@2
WARNING: Lua_V1::SetGamma, implement opcode, level: 0.000000!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: !!!! Trying to call MakeSectorActive without a scene!
WARNING: Lua_V1::SetGamma, implement opcode, level: 0.000000!
but obviously there are some things wrong.

1) Videos are down to 2-7 fps (while they were at ~30 fps with OpenGL only
2) The gameplay itself sped up to 20-25 fps, where it was at 10-15 with OpenGL only
3) The colors are all wrong, every animated character (Manny, NPC, pidgeons etc.) and i.e. the floor in Manny's office where his shadow is drawn is completely pink.


Any help greatly appreciated
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

The config.log result is fine. The last compilation attempt succeeds.

However the residualvm output is weird. It seems like TinyGL is being used instead of the shaders renderer. Did you select "OpenGL with shaders" in the graphics options?
Could you post a log file with debugging output level 5 enabled?
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

It doesn't seem to work correctly right now.

I only have "default" and "Software" in Graphic options

Code: Select all

Debuglevel (from command line): 5
Using SDL Video Driver "os4"
Using SDL Audio Driver "amigaos4"
Output sample rate: 44100 Hz
Output buffer size: 1024 samples
User picked target 'grim-win' (gameid 'grim')...
  Looking for a plugin supporting this gameid... Grim Engine
  Starting 'Grim Fandango'
Starting detection in dir 'Games:GamesVM/Lucas Arts/Grim Fandango/'
> 'VOX0001.LAB': '8b12ed530195c6c577436df27df62ecb'
MD5 Mismatch. Skipping (444f05f2af689c1bffd179b8b6a632bd) (8b12ed530195c6c577436df27df62ecb)
Skipping game: grim ( Windows/English) (0)
Matched file: VOX0001.LAB
Found game: grim ( Windows/English) (1)
 ... new best match, removing all previous candidates
Skipping game: grim (Demo Windows/English) (7)
Skipping game: grim (Demo Windows/English) (8)
Skipping game: monkey4 ( Windows/English) (13)
Skipping game: monkey4 (Demo Windows/English) (26)
Running Grim Fandango (Windows/English)
INFO: TinyGL front buffer pixel format: RGB565@2

EDIT:
Is there an inapp/ingame key combo to make a screenshot (like in ScummVM?)
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

In config.log do you also have the check for linking with GLESv2?

Code: Select all

int main(void) { return 0; }

g++    -g -ansi -W -Wno-unused-parameter -Wno-empty-body -pedantic -Wno-long-long  ./residualvm-conf.cpp -o ./residualvm-conf -DSDL_BACKEND -DPOSIX -DHAS_POSIX_SPAWN -lGLESv2
return code: 0
There is no key to save a screenshot in ResidualVM at the moment, but it would be a welcome addition.
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

bgK wrote:In config.log do you also have the check for linking with GLESv2?

Code: Select all

int main(void) { return 0; }

g++    -g -ansi -W -Wno-unused-parameter -Wno-empty-body -pedantic -Wno-long-long  ./residualvm-conf.cpp -o ./residualvm-conf -DSDL_BACKEND -DPOSIX -DHAS_POSIX_SPAWN -lGLESv2
return code: 0
There is no key to save a screenshot in ResidualVM at the moment, but it would be a welcome addition.
Yes, but it errors
int main(void) { return 0; }

g++ -athread=native -Wl,--no-keep-memory -L/sdk/local/newlib/lib -Wl,--export-dynamic -L/sdk/local/newlib/lib --std=gnu++11 -gstabs -W -Wno-unused-parameter -Wno-empty-body -pedantic -Wno-long-long -Wno-format ./residualvm-conf.cpp -o ./residualvm-conf -DPPC_TARGET -DSDL_BACKEND -lGLESv2
Development:Coding/SDK/gcc/ppc-amigaos/bin/ld: cannot find -lGLESv2
return code: 1
Hmm, seems on my system it depends on -lGLES2 wihtout the "v"
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

Does ResidualVM work if you edit the configure script to use the library as it is on your system?
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

bgK wrote:Does ResidualVM work if you edit the configure script to use the library as it is on your system?
Yes, i can make it see my GLES2 installation, but only when using "-logles2" instead of -lGLESv2".

configure doesn't complain anymore

Code: Select all

Checking for GL Extension Wrangler (GLEW)... not needed with OpenGL ES v2
Checking for OpenGL... yes (OpenGL ES2)
Even the STARK engine will be compiled now (was skipped before due to missing shaders), but now i get an error on compiling in said STARK engine

Code: Select all

    C++      engines/stark/gfx/opengltexture.o
In file included from /SDK/local/common/include/GLES2/gl2platform.h:32,
                 from /SDK/local/common/include/GLES2/gl2.h:39,
                 from ./graphics/opengl/system_headers.h:35,
                 from engines/stark/gfx/opengltexture.cpp:28:
engines/stark/gfx/opengltexture.cpp: In constructor 'Stark::Gfx::OpenGlTexture::OpenGlTexture()':
engines/stark/gfx/opengltexture.cpp:37:19: error: invalid conversion from 'uint32*' {aka 'long unsigned int*'} to 'GLuint*' {aka 'unsigned int*'} [-fpermissive]
  glGenTextures(1, &_id);
                   ^
engines/stark/gfx/opengltexture.cpp: In destructor 'virtual Stark::Gfx::OpenGlTexture::~OpenGlTexture()':
engines/stark/gfx/opengltexture.cpp:49:22: error: invalid conversion from 'uint32*' {aka 'long unsigned int*'} to 'const GLuint*' {aka 'const unsigned int*'} [-fpermissive]
  glDeleteTextures(1, &_id);
                      ^
gmake: *** [engines/stark/gfx/opengltexture.o] Error 1
I'm on Big Endian PPC
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

bgK wrote:Does ResidualVM work if you edit the configure script to use the library as it is on your system?
Unfortunately not...seems my GLES2 isn't fit for the task (yet)

Compiled without STARK, this is what i get on starting residualvm

Code: Select all

Could not compile shader box.vertex: ERROR: Code generation failed.
Error log:
Boolean uniforms aren't supported yet:
	offset: 24, size: 1, Bool flipY
INTERNAL ERROR: OpBranchConditional instruction's source parameters are missing

!
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

Well then, too bad.

I've pushed a fix so Stark should build for you. However it won't run without boolean uniforms either.
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

No problem, thanks for the fix, i'll come back to this thread once i find other problems.

At least i have something to annoy the GLES2 devs now :-)
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

Next compiler error:

Code: Select all

    C++      engines/stark/gfx/openglsactor.o
engines/stark/gfx/openglsactor.cpp:174:8: error: no declaration matches 'uint32 Stark::Gfx::OpenGLSActorRenderer::createModelVBO(const Stark::Model*)'
 uint32 OpenGLSActorRenderer::createModelVBO(const Model *model) {
        ^~~~~~~~~~~~~~~~~~~~
In file included from engines/stark/gfx/openglsactor.cpp:23:
./engines/stark/gfx/openglsactor.h:61:9: note: candidate is: 'GLuint Stark::Gfx::OpenGLSActorRenderer::createModelVBO(const Stark::Model*)'
  GLuint createModelVBO(const Model *model);
         ^~~~~~~~~~~~~~
./engines/stark/gfx/openglsactor.h:43:7: note: 'class Stark::Gfx::OpenGLSActorRenderer' defined here
 class OpenGLSActorRenderer : public VisualActor {
       ^~~~~~~~~~~~~~~~~~~~
engines/stark/gfx/openglsactor.cpp:209:8: error: no declaration matches 'uint32 Stark::Gfx::OpenGLSActorRenderer::createFaceEBO(const Stark::Face*)'
 uint32 OpenGLSActorRenderer::createFaceEBO(const Face *face) {
        ^~~~~~~~~~~~~~~~~~~~
In file included from engines/stark/gfx/openglsactor.cpp:23:
./engines/stark/gfx/openglsactor.h:62:9: note: candidate is: 'GLuint Stark::Gfx::OpenGLSActorRenderer::createFaceEBO(const Stark::Face*)'
  GLuint createFaceEBO(const Face *face);
         ^~~~~~~~~~~~~
./engines/stark/gfx/openglsactor.h:43:7: note: 'class Stark::Gfx::OpenGLSActorRenderer' defined here
 class OpenGLSActorRenderer : public VisualActor {
       ^~~~~~~~~~~~~~~~~~~~
gmake: *** [engines/stark/gfx/openglsactor.o] Error 1
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

My mistake, I missed a few types. Should be better now.
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

Now it compiles through :-)

Thanks a bunch
User avatar
Raziel
ScummVM Porter
Posts: 1542
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet
Contact:

Re: AmigaOS4 OpenGLES

Post by Raziel »

@bgK

Could you als add an exception for AmigaOS4 in configure to use "-logles2"?
bgK
ScummVM Developer
Posts: 71
Joined: Sat Feb 13, 2016 12:40 pm

Re: AmigaOS4 OpenGLES

Post by bgK »

I would much rather find a way to look up the glesv2 library on your system rather than adding a special case. On my setup, I can lookup the glesv2 library using "pkg-config glesv2 --libs" does that work for you?
Post Reply