Hi Stephan
>perhaps all you have to do is this:
>replace "#define LOAD_FBO_EXT .." in FrameBufferObject.cpp (around line
42) with
>#if defined(OSG_GLES1_AVAILABLE)
> #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
>std::string(#name)+std::string("OES") ).c_str() )
>#else
> #define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
>std::string(#name)+std::string("EXT") ).c_str() )
>#endif
>Do you have a simple demo cpp to test this issue?
I got round to trying FBOs with the modification you suggested. Here's what
I ended up using as GLES2 doesn't use the OES suffix.
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#if defined(OSG_GLES1_AVAILABLE)
#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string("OES") ).c_str() )
#else
#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name),
std::string(#name).c_str() )
#endif
#else
#define LOAD_FBO_EXT(name) setGLExtensionFuncPtr(name, (#name), (
std::string(#name)+std::string("EXT") ).c_str() )
#endif
I've got no Idea if the whole OES thing is iOs specific or not.
Any how, it hasn't worked but I'm only getting one complaint
Error: glDrawBuffers not supported by OpenGL driver
I've made a simple example that is attached and I've also attached the full
log with debug_fp set. Bear in mind i'm using GLES2 so there's some shader
gen stuff that shouldn't be relevant.
I'm gonna continue digging but would really appreciate if you could lend a
hand. Once this is working I think we have the full set of features I
commonly use in OSG all working for IPhone. Yippee
Tom
run
Running…
[Switching to thread 11523]
[Switching to thread 11523]
sharedlibrary apply-load-rules all
continue
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
Adding parent0x6075c0
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
DatabasePager::addDatabaseThread() HANDLE_NON_HTTP
DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP
Render::Render() 0x652cd0
CullSettings::readEnvironmentalVariables()
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
CullSettings::readEnvironmentalVariables()
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
ShaderComposer::ShaderComposer() 0x651b00
CullSettings::readEnvironmentalVariables()
Adding parent0x6075c0
ShaderComposer::ShaderComposer() 0x6546d0
Adding parent0x6075c0
_availableQueue.size()=2
View::setSceneData() Reusing exisitng scene0x651c30
ShaderComposer::ShaderComposer() 0x655810
ShaderComposer::~ShaderComposer() 0x655810
CameraManipulator::computeHomePosition(0, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
CameraManipulator::computeHomePosition(0x833a00, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
Viewer::realize() - No valid contexts found, setting up view across all screens.
GraphicsContext::getWindowingSystemInterface() 0x608cd0 0x236494
GraphicsContext::registerGraphicsContext 0x655a30
ShaderComposer::ShaderComposer() 0x655d00
GraphicsContext::createNewContextID() creating contextID=0
Updating the MaxNumberOfGraphicsContexts to 1
GraphicsWindow has been created successfully.
Adding parent0x6075c0
CameraManipulator::computeHomePosition(0, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
CameraManipulator::computeHomePosition(0x833a00, 0)
boundingSphere.center() = (0 0 0)
boundingSphere.radius() = 0.866025
osg::State::_maxTexturePoolSize=0
osg::State::_maxBufferObjectPoolSize=0
GraphicsContext::getWindowingSystemInterface() 0x608cd0 0x236494
GraphicsWindowIPhone::realizeImplementation / ownsWindow: 1
GraphicsWindowIPhone::realizeImplementation: INFO: Created UIWindow with bounds
'320, 480' (points).
GraphicsWindowIPhone::realizeImplementation: INFO: Created OpenGLES1 Context.
GraphicsWindowIPhone::realizeImplementation / view: 0x658d40
shouldAutorotateToInterfaceOrientation for 1: YES
shouldAutorotateToInterfaceOrientation for 1: YES
GraphicsWindowIPhone :: grabFocusIfPointerInWindow not implemented yet
View::init()
OpenGL extensions supported by installed OpenGL drivers are:
GL_APPLE_framebuffer_multisample
GL_APPLE_rgb_422
GL_APPLE_texture_format_BGRA8888
GL_APPLE_texture_max_level
GL_EXT_blend_minmax
GL_EXT_discard_framebuffer
GL_EXT_read_format_bgra
GL_EXT_shader_texture_lod
GL_EXT_texture_filter_anisotropic
GL_IMG_read_format
GL_IMG_texture_compression_pvrtc
GL_OES_depth24
GL_OES_depth_texture
GL_OES_fbo_render_mipmap
GL_OES_mapbuffer
GL_OES_packed_depth_stencil
GL_OES_rgb8_rgba8
GL_OES_standard_derivatives
GL_OES_texture_float
GL_OES_texture_half_float
GL_OES_vertex_array_object
OpenGL extension 'GL_ARB_vertex_shader' is not supported.
ShaderComposer::~ShaderComposer() 0x651b00
Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile
OpenGL extension 'GL_EXT_geometry_shader4' is not supported.
OpenGL extension 'GL_EXT_gpu_shader4' is not supported.
glVersion=0, isGlslSupported=YES, glslLanguageVersion=0
State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
#ifndef GL_ES
#if (__VERSION__ <= 110)
#define lowp
#define mediump
#define highp
#endif
#endif
// colors a fragment based on its position
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
varying mediump vec4 color;
void main(void) {
color = osg_Vertex;
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}
++++++++
-------- Converted source
#ifndef GL_ES
#if (__VERSION__ <= 110)
#define lowp
#define mediump
#define highp
#endif
#endif
// colors a fragment based on its position
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
varying mediump vec4 color;
void main(void) {
color = osg_Vertex;
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}
----------------
Compiling VERTEX source:
1: #ifndef GL_ES
2: #if (__VERSION__ <= 110)
3: #define lowp
4: #define mediump
5: #define highp
6: #endif
7: #endif
8: // colors a fragment based on its position
9: attribute vec4 osg_Vertex;
10: uniform mat4 osg_ModelViewProjectionMatrix;
11: varying mediump vec4 color;
12: void main(void) {
13: color = osg_Vertex;
14: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
15: }
Compiling FRAGMENT source:
1: #ifndef GL_ES
2: #if (__VERSION__ <= 110)
3: #define lowp
4: #define mediump
5: #define highp
6: #endif
7: #endif
8: varying mediump vec4 color;
9: void main(void) {
10: gl_FragColor = clamp( color, 0.0, 1.0 );
11: }
Linking osg::Program "colorShader" id=3 contextID=0
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 binding 7, osg_MultiTexCoord4
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 6, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
Program "colorShader" link succeded, infolog:
WARNING: Could not find vertex shader attribute 'osg_Color' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_FogCoord' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord0' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord1' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord2' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord3' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord4' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_Normal' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_SecondaryColor' to match
BindAttributeLocation request.
Uniform "osg_ModelViewProjectionMatrix" loc=0 size=1 type=mat4
Attrib "osg_Vertex" loc=0 size=1
State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
#ifndef GL_ES
#if (__VERSION__ <= 110)
#define lowp
#define mediump
#define highp
#endif
#endif
attribute vec4 osg_Vertex;
attribute vec4 osg_MultiTexCoord0;
uniform mat4 osg_ModelViewProjectionMatrix;
varying mediump vec2 texCoord0;
void main(void) {
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
texCoord0 = osg_MultiTexCoord0.xy;
}
++++++++
-------- Converted source
#ifndef GL_ES
#if (__VERSION__ <= 110)
#define lowp
#define mediump
#define highp
#endif
#endif
attribute vec4 osg_Vertex;
attribute vec4 osg_MultiTexCoord0;
uniform mat4 osg_ModelViewProjectionMatrix;
varying mediump vec2 texCoord0;
void main(void) {
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
texCoord0 = osg_MultiTexCoord0.xy;
}
----------------
Compiling VERTEX source:
1: #ifndef GL_ES
2: #if (__VERSION__ <= 110)
3: #define lowp
4: #define mediump
5: #define highp
6: #endif
7: #endif
8: attribute vec4 osg_Vertex;
9: attribute vec4 osg_MultiTexCoord0;
10: uniform mat4 osg_ModelViewProjectionMatrix;
11: varying mediump vec2 texCoord0;
12: void main(void) {
13: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
14: texCoord0 = osg_MultiTexCoord0.xy;
15: }
Compiling FRAGMENT source:
1: #ifndef GL_ES
2: #if (__VERSION__ <= 110)
3: #define lowp
4: #define mediump
5: #define highp
6: #endif
7: #endif
8: uniform sampler2D diffuseTexture;
9: varying mediump vec2 texCoord0;
10: void main(void) {
11: gl_FragColor = texture2D(diffuseTexture, texCoord0);
12: }
Linking osg::Program "textureShader" id=6 contextID=0
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 binding 7, osg_MultiTexCoord4
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 6, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
Program "textureShader" link succeded, infolog:
WARNING: Could not find vertex shader attribute 'osg_Color' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_FogCoord' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord1' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord2' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord3' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord4' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_Normal' to match
BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_SecondaryColor' to match
BindAttributeLocation request.
Uniform "osg_ModelViewProjectionMatrix" loc=0 size=1 type=mat4
Uniform "diffuseTexture" loc=4 size=1 type=sampler2D
Attrib "osg_MultiTexCoord0" loc=3 size=1
Attrib "osg_Vertex" loc=0 size=1
OpenGL extension 'GL_ARB_vertex_program' is not supported.
OpenGL extension 'GL_EXT_secondary_color' is not supported.
OpenGL extension 'GL_EXT_fog_coord' is not supported.
OpenGL extension 'GL_ARB_multitexture' is not supported.
OpenGL extension 'GL_NV_occlusion_query' is not supported.
OpenGL extension 'GL_ARB_occlusion_query' is not supported.
OpenGL extension 'GL_EXT_timer_query' is not supported.
OpenGL extension '' is not supported.
OpenGL extension 'GL_EXT_packed_depth_stencil' is not supported.
Setting up osg::Camera::FRAME_BUFFER_OBJECT
Error: glDrawBuffers not supported by OpenGL driver
Error: glDrawBuffers not supported by OpenGL driver
Setting up osg::Camera::FRAME_BUFFER
Error: glDrawBuffers not supported by OpenGL driver
Error: glDrawBuffers not supported by OpenGL driver
Error: glDrawBuffers not supported by OpenGL driver
osgAppDelegate.h
Description: Binary data
osgAppDelegate.mm
Description: Binary data
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

