Re: [osg-users] OSG on OMAP3 (Beagleboard)
Hi David, I believe the shaders are actually compiliant with GLES 2.0, but the drivers you have add they own restrictions. Could you send me the modified files so I can review them with a view to merging them in some form. Cheers, Robert. On Thu, Jan 21, 2010 at 8:37 PM, picoflamingo picoflami...@papermint-designs.com wrote: Hello, Not sure if this has been reported so far (I couldn't find anything in the mailing list archive). I have been trying to run OSG 2.9.6 in a BeagleBoard (OpenGL ES 2.0) with partial success. Just after compiling, when running osgviewer, I got a window with the classical OSG blue background but nothing was rendered. Looking at the log, I found that the vertex and fragment shaders compilation failed. The main problem is that the OpenGL ES 2.0 library for the BeagleBoard expects a precision qualifier for every single declaration. This doesn't happen in the Imagination emulator, so it has to be tried in the real HW (AFAIK). I modified the ShaderGen.cpp file to include the missing qualifiers (I just prepend highp to every single vec and mat declaration, including attributes, uniforms and varyings). I also modify State.cpp to add the qualifier to the different Uniforms, but I'm not sure if that had some effect. Finally, I just override the ShaderGen.cpp to produce a simple vertex/fragment shader-pair just to check that it can render something, and that worked for simple color objects (no material, no texture,...). I could render the axis.osg and glider.osg models. I do not know enough about OSG internals to produce a proper patch for this, so hope that this information could help to make OSG work in the BeagleBoard (and probably in other OMAP3 platforms -OpenPandora, N900,..-) in the next stable release. If I can help in any way (as tester for instance), please just let me know. I was using the OSG 2.9.6 tarball, not the svn version, so if this is already fixed, please ignore this message. Many thanks. david -- picoFlamingo Project: http://community.papermint-designs.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG on OMAP3 (Beagleboard)
Hi David, Thanks for the file changes, I'll have a look once I'm back at my work machine. W.r.t results from different models, the osgUtil::ShaderGen class that is used to convert fixed function scene graph state into shaders+uniforms is not complete, it only maps a modest range of fixed OpenGL state so not all scene graphs can be mapped correctly. As things stand the way to use OSG+GLES2 is to build your scene graphs with shaders appropriate for you target platform. This does put more onus on you developing the application as there is no fixed function pipeline there as a fallback. Robert. On Fri, Jan 22, 2010 at 8:53 PM, picoflamingo picoflami...@papermint-designs.com wrote: Hi Robert, Please find attached the files I modified (osg/State.cpp and osgUtil/ShaderGen.cpp). I just change the ifs related to my test model that are very simple, just geometry and color/material. With the modification in the attached files I can see the glider.osg without problems, but trying to load some 3DS models with material produces black pixels (almost that is what I think)... I just see the silhouette. I have to force a value for the color in the vertex shader in order to get a grey-shaded model I also include a DEBUG_INFO log (for instance the list of supported extensions could be useful). Hope that could help. Many thanks for looking into this. cheers! david Robert Osfield wrote: Hi David, I believe the shaders are actually compiliant with GLES 2.0, but the drivers you have add they own restrictions. Could you send me the modified files so I can review them with a view to merging them in some form. Cheers, Robert. On Thu, Jan 21, 2010 at 8:37 PM, picoflamingo picoflami...@papermint-designs.com wrote: Hello, Not sure if this has been reported so far (I couldn't find anything in the mailing list archive). I have been trying to run OSG 2.9.6 in a BeagleBoard (OpenGL ES 2.0) with partial success. Just after compiling, when running osgviewer, I got a window with the classical OSG blue background but nothing was rendered. Looking at the log, I found that the vertex and fragment shaders compilation failed. The main problem is that the OpenGL ES 2.0 library for the BeagleBoard expects a precision qualifier for every single declaration. This doesn't happen in the Imagination emulator, so it has to be tried in the real HW (AFAIK). I modified the ShaderGen.cpp file to include the missing qualifiers (I just prepend highp to every single vec and mat declaration, including attributes, uniforms and varyings). I also modify State.cpp to add the qualifier to the different Uniforms, but I'm not sure if that had some effect. Finally, I just override the ShaderGen.cpp to produce a simple vertex/fragment shader-pair just to check that it can render something, and that worked for simple color objects (no material, no texture,...). I could render the axis.osg and glider.osg models. I do not know enough about OSG internals to produce a proper patch for this, so hope that this information could help to make OSG work in the BeagleBoard (and probably in other OMAP3 platforms -OpenPandora, N900,..-) in the next stable release. If I can help in any way (as tester for instance), please just let me know. I was using the OSG 2.9.6 tarball, not the svn version, so if this is already fixed, please ignore this message. Many thanks. david -- picoFlamingo Project: http://community.papermint-designs.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org RegisterWindowingSystemInterfaceProxy() X11WindowingSystemInterface() GraphicsContext::setWindowingSystemInterface() 0x1ad68 0x40a46b44 CullSettings::readEnvironmentalVariables() DatabasePager::addDatabaseThread() HANDLE_NON_HTTP DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() itr='/home/root/osg/lib' FindFileInPath() : trying /home/root/osg/lib/osgPlugins-2.9.6/osgdb_3ds.so ... FindFileInPath() : USING /home/root/osg/lib/osgPlugins-2.9.6/osgdb_3ds.so Opened DynamicLibrary osgPlugins-2.9.6/osgdb_3ds.so FindFileInPath(../3D1.3ds): returning ../3D1.3ds NODE TRAVERSAL of 3ds file LIB3DS MESH TRAVERSAL of 3ds file LIB3DS mesh name Font 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 Warning: in 3ds loader: file has no nodes, traversing by meshes instead Final OSG node structure looks like this: Group Geode View::setSceneData() Reusing exisitng scene0x1b2c8
Re: [osg-users] OSG on OMAP3 (Beagleboard)
Hi, sorry, I don't have any answers for you, but I have a Beagleboard that I've not booted in a while. What OpenGL drivers are you using? rgds jp picoflamingo wrote: Hello, Not sure if this has been reported so far (I couldn't find anything in the mailing list archive). I have been trying to run OSG 2.9.6 in a BeagleBoard (OpenGL ES 2.0) with partial success. Just after compiling, when running osgviewer, I got a window with the classical OSG blue background but nothing was rendered. Looking at the log, I found that the vertex and fragment shaders compilation failed. The main problem is that the OpenGL ES 2.0 library for the BeagleBoard expects a precision qualifier for every single declaration. This doesn't happen in the Imagination emulator, so it has to be tried in the real HW (AFAIK). I modified the ShaderGen.cpp file to include the missing qualifiers (I just prepend highp to every single vec and mat declaration, including attributes, uniforms and varyings). I also modify State.cpp to add the qualifier to the different Uniforms, but I'm not sure if that had some effect. Finally, I just override the ShaderGen.cpp to produce a simple vertex/fragment shader-pair just to check that it can render something, and that worked for simple color objects (no material, no texture,...). I could render the axis.osg and glider.osg models. I do not know enough about OSG internals to produce a proper patch for this, so hope that this information could help to make OSG work in the BeagleBoard (and probably in other OMAP3 platforms -OpenPandora, N900,..-) in the next stable release. If I can help in any way (as tester for instance), please just let me know. I was using the OSG 2.9.6 tarball, not the svn version, so if this is already fixed, please ignore this message. Many thanks. david -- picoFlamingo Project: http://community.papermint-designs.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG on OMAP3 (Beagleboard)
Hi, J.P. Delport wrote: Hi, sorry, I don't have any answers for you, but I have a Beagleboard that I've not booted in a while. What OpenGL drivers are you using? I'm using the open source driver for SGX. But the differences are in the GLES libraries not in the driver, as far as I know. For the libraries I tried versions 3.00.00.06 and 3.00.00.09 from TI's Graphics SDK. I will try to provide a log with higher notification level tonight (I cannot do it now), but this is an example of the kind of errors produced. Regards david --8--- ++Before Converted source varying vec3 normalDir; varying vec3 lightDir; varying vec3 viewDir; void main() { gl_Position = ftransform(); gl_TexCoord[0] = gl_MultiTexCoord0; normalDir = gl_NormalMatrix * gl_Normal; vec3 dir = -vec3(gl_ModelViewMatrix * gl_Vertex); viewDir = dir; vec4 lpos = gl_LightSource[0].position; if (lpos.w == 0.0) lightDir = lpos.xyz; else lightDir = lpos.xyz + dir; } Converted source uniform mat3 osg_NormalMatrix; uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; attribute vec4 osg_MultiTexCoord0; attribute vec4 osg_Vertex; attribute vec3 osg_Normal; varying vec3 normalDir; varying vec3 lightDir; varying vec3 viewDir; void main() { gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; gl_TexCoord[0] = osg_MultiTexCoord0; normalDir = osg_NormalMatrix * osg_Normal; vec3 dir = -vec3(osg_ModelViewMatrix * osg_Vertex); viewDir = dir; vec4 lpos = gl_LightSource[0].position; if (lpos.w == 0.0) lightDir = lpos.xyz; else lightDir = lpos.xyz + dir; } VERTEX glCompileShader FAILED VERTEX Shader infolog: Compile failed. ERROR: 0:14: 'gl_TexCoord' : undeclared identifer ERROR: 0:14: 'gl_TexCoord' : left of '[' is not of type array, matrix, or vector ERROR: 0:14: 'assign' : cannot convert from 'attribute 4-component vector of float' to 'float' ERROR: 0:18: 'gl_LightSource' : undeclared identifer ERROR: 0:18: 'gl_LightSource' : left of '[' is not of type array, matrix, or vector ERROR: 0:18: 'position' : illegal vector field selection ERROR: 0:18: 'assign' : cannot convert from 'float' to '4-component vector of float' ERROR: 7 compilation errors. No code generated. FRAGMENT glCompileShader FAILED FRAGMENT Shader infolog: Compile failed. ERROR: 0:1: 'vec3' : No precision defined for this type ERROR: 0:2: 'vec3' : No precision defined for this type ERROR: 0:3: 'vec3' : No precision defined for this type ERROR: 0:8: 'vec4' : No precision defined for this type ERROR: 0:8: 'gl_TexCoord' : undeclared identifer ERROR: 0:8: 'gl_TexCoord' : left of '[' is not of type array, matrix, or vector ERROR: 0:8: 'st' : field selection requires structure or vector on left hand side ERROR: 0:8: 'texture2D' : no matching overloaded function found ERROR: 0:8: 'assign' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:9: 'vec3' : No precision defined for this type ERROR: 0:10: 'vec3' : No precision defined for this type ERROR: 0:11: 'vec3' : No precision defined for this type ERROR: 0:12: 'vec4' : No precision defined for this type ERROR: 0:12: 'gl_FrontLightModelProduct' : undeclared identifer ERROR: 0:12: 'sceneColor' : field selection requires structure, vector, or matrix on left hand side ERROR: 0:12: 'assign' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:13: 'gl_FrontLightProduct' : undeclared identifer ERROR: 0:13: 'gl_FrontLightProduct' : left of '[' is not of type array, matrix, or vector ERROR: 0:13: 'ambient' : illegal vector field selection ERROR: 0:14: 'float' : No precision defined for this type ERROR: 0:15: 'gl_FrontLightProduct' : undeclared identifer ERROR: 0:15: 'gl_FrontLightProduct' : left of '[' is not of type array, matrix, or vector ERROR: 0:15: 'diffuse' : illegal vector field selection ERROR: 0:19: 'vec3' : No precision defined for this type ERROR: 0:20: 'gl_FrontLightProduct' : undeclared identifer ERROR: 0:20: 'gl_FrontLightProduct' : left of '[' is not of type array, matrix, or vector ERROR: 0:20: 'specular' : illegal vector field selection ERROR: 0:20: 'rgb' : field selection requires structure or vector on left hand side ERROR: 0:20: '*' : Wrong operand types. No operation '*' exists that takes a left-hand operand of type 'float' and a right operand of type 'invalid' (and there is no acceptable conversion) ERROR: 0:21: 'gl_FrontMaterial' : undeclared identifer ERROR: 0:21: 'shininess' : field selection requires structure, vector, or matrix on left hand side ERROR: 31 compilation errors. No code generated. State's vertex attrib binding 2, osg_Color State's vertex attrib binding 7, osg_FogCoord State's vertex attrib binding 3, osg_MultiTexCoord0 State's vertex attrib binding 4, osg_MultiTexCoord1 State's vertex attrib binding 5, osg_MultiTexCoord2 State's vertex attrib binding 6, osg_MultiTexCoord3 State's vertex attrib