[osg-users] latest dev code and OpenGL ES 2.0 on linux/windows

93 views
Skip to first unread message

Sergey Kurdakov

unread,
Jul 23, 2013, 12:19:54 PM7/23/13
to OpenSceneGraph Users
Hi,

I try to make some experiments with OpenGL ES 2.0 on both windows and linux,
and while I myself is searching for answers ( I think will resolve in
coming days ), I will share few observations for anyone concerned.

I have following problem with latest development code.

On windows

using http://code.google.com/p/angleproject/ and
https://github.com/fantasydr/sdl-gles and SDL viewer example I
attempted to have
OpenGL ES 2.0 with visual studio compiler

( I used recommended settings )

Cmake settings for OpenGL ES 2.0
OSG_GL1_AVAILABLE OFF
OSG_GL2_AVAILABLE OFF
OSG_GL3_AVAILABLE OFF
OSG_GLES1_AVAILABLE OFF
OSG_GLES2_AVAILABLE ON
OPENGL_INCLUDE_DIR /pathtogles/include/
OPENGL_LIBRARY /pathtogles/lib/libGLESv2.so
OPENGL_egl_LIBRARY /pathtoegllib/libEGL.so
OSG_GL_DISPLAYLISTS_AVAILABLE OFF
SG_GL_MATRICES_AVAILABLE OFF
OSG_GL_VERTEX_FUNCS_AVAILABLE OFF
OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE OFF
OSG_GL_FIXED_FUNCTION_AVAILABLE OFF
OSG_CPP_EXCEPTIONS_AVAILABLE OFF

While mostly it works - it compiles and runs, it fails to compile
build-in osg shaders ( though I checked to have D3Dcompiler_46.dll in
bin folder otherwise http://code.google.com/p/angleproject/ will not
work outside visual studio ),

You might find my OpenGL ES/SDL cpp file in attachment.

to check further problem I also compiled osg on linux with mesa es
2.0 support (on latest ubuntu )
with exact paths for opengl

OPENGL_egl_LIBRARY /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1

OPENGL_gl_LIBRARY /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so

somehow I also get problems in release build I get from osgviewer with cow.osg

the output reads

GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion=1
iMinorVersion=4
GraphicsWindowX11::init() - window created =1
Warning: TexGen::apply(State&) - not supported.
Warning: Material::apply(State&) - not supported.
Warning: TexGen::apply(State&) - not supported.

and no cow is visible

So does it mean that current opengl es implementation unusable?

(I will bebug on linux tomorrow, because so far adding
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Debug )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG" )
ENDIF( NOT CMAKE_BUILD_TYPE )

to CMakeLists.txt causes problem with linker ( not sure it problem
with CMakeLists.txt or with my actions -
I'm not very quick when on linux ).

Regards
Sergey
osgviewerSDL.cpp

Sergey Kurdakov

unread,
Jul 23, 2013, 1:40:08 PM7/23/13
to OpenSceneGraph Users
Hi,

managed to compile latest osg debug on linux ( possible cmake-gui made
some some strange things after severl reconfigurations - absolutely
clean svn code compiled just fine ).

but still the same error in osgviewer ( now osgviewerd ) with OpenGL
ES 2.0 enabled

> GraphicsWindowX11::init() - eglInitialize() succeded eglMajorVersion=1
> iMinorVersion=4
> GraphicsWindowX11::init() - window created =1
> Warning: TexGen::apply(State&) - not supported.
> Warning: Material::apply(State&) - not supported.
> Warning: TexGen::apply(State&) - not supported.

I will look with debugger tomorrow. but a small question - is such
output is expected on linux or is it osg bug?


Regards
Sergey
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Robert Osfield

unread,
Jul 23, 2013, 2:06:39 PM7/23/13
to OpenSceneGraph Users
Hi Sergey,


OpenGL ES 2.0 does not support TexGen or Material, and in fact has fixed function pipeline at all.

When using OpenGL ES 2.0 you need to use shaders exclusively, there is the osgUtil::ShaderGenVisitor that can attempt to convert some fixed function scene graphs across to shaders for you but it's not very sophisticated so can only handle quite simple scene graphs.

For all real work with GLES 2.0 you'll need to use custom shaders.

Robert.
 

Sergey Kurdakov

unread,
Jul 23, 2013, 10:17:48 PM7/23/13
to OpenSceneGraph Users
Hi Robert,

> OpenGL ES 2.0 does not support TexGen or Material, and in fact has fixed
> function pipeline at all.

yes, just forgot it and seen few shaders in replacement of fixed pipeline.

> When using OpenGL ES 2.0 you need to use shaders exclusively, there is the
> osgUtil::ShaderGenVisitor that can attempt to convert some fixed function
> scene graphs across to shaders for you but it's not very sophisticated so
> can only handle quite simple scene graphs.

ok, thanks.

Sergey Kurdakov

unread,
Jul 24, 2013, 9:45:05 AM7/24/13
to OpenSceneGraph Users
Hi all,

in attachment there is a working SDL 2.0/OpenGl ES 2.0 windows ready
code ( but slightly incomplete for submission ( no resize handles due
to change in SDL api ) - will polish it later after I do some other
OpenGL ES tweaks I intend to try )

this effectively allows to debug OpenGL ES 2.0 programs on windows
without wgl ( did not find anyway a step by step instruction how to
work with wgl/OpenGL ES 2.0 on windows with OpenSceneGraph )

(and on linux it is already possible to debug OpenGL ES 2.0 in natural
way via mesa and egl/X11 GraphicsWindow)

what software is needed to run this sample

http://code.google.com/p/angleproject/ should be compiled with DX11
support ( enable ANGLE_ENABLE_D3D11 flag )

https://github.com/fantasydr/sdl-gles

configuration of OpenSceneGraph as recommended for OpenGL ES 2.0.


Regards
Sergey
osgviewerSDL.zip
Reply all
Reply to author
Forward
0 new messages