ResidualVM logo Forum Index - ResidualVM website - Contact us - Rules Login    Register     Search curved edge
It is currently Fri Dec 14, 2018 8:32 pm

All times are UTC




Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 12:15 am 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
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:
#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:
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


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 6:46 am 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
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?


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 8:09 am 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
It doesn't seem to work correctly right now.

I only have "default" and "Software" in Graphic options
Code:
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?)


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 11:21 am 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
In config.log do you also have the check for linking with GLESv2?

Code:
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.


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 12:08 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
bgK wrote:
In config.log do you also have the check for linking with GLESv2?

Code:
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

Quote:
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"


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 12:20 pm 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
Does ResidualVM work if you edit the configure script to use the library as it is on your system?


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 12:57 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
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:
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:
    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


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 1:36 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
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:
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

!


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 1:42 pm 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
Well then, too bad.

I've pushed a fix so Stark should build for you. However it won't run without boolean uniforms either.


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 1:48 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
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 :-)


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 1:59 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
Next compiler error:

Code:
    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


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 2:16 pm 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
My mistake, I missed a few types. Should be better now.


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 3:22 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
Now it compiles through :-)

Thanks a bunch


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 3:31 pm 
Offline
User avatar

Joined: Tue May 05, 2009 10:57 am
Posts: 74
Location: amigans.net
@bgK

Could you als add an exception for AmigaOS4 in configure to use "-logles2"?


Top
 Profile  
 
 Post subject: Re: AmigaOS4 OpenGLES
PostPosted: Sun Nov 11, 2018 6:03 pm 
Offline

Joined: Tue Feb 12, 2013 6:10 pm
Posts: 53
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Forum design by ScummVM team, icons by raina, adopted for ResidualVM
curved edge   curved edge