OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

GLES link error for unidentified Program


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
a.terenzi (Alessandro Terenzi)
Appreciator


Joined: 03 Sep 2009
Posts: 250

PostPosted: Wed Jan 24, 2018 4:17 pm    Post subject:
GLES link error for unidentified Program
Reply with quote

Hi,
I used to work with OSG 3.4.0 (stable) and now I'm trying version 3.5.10 on iOS (trying both GLES 2 and 3) but now I having the following error when the first frame is drawn:

glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.


Note that I have only one quad to which I apply a texture, I'm using a single 'vertex' and 'fragment shader' and there's only on 'program' around. The same code works fine with OSG 3.4.0 and even though with version 3.5.10 there is the above error, the texture is nonetheless displayed.

If I use a more verbose notification level I see that my program "BckProgram" is compiled and linked correctly but then another program with empty name is tried to be linked and it is the one for which I'm receiving the above error, but I did not create a second program anywhere... am I missing something?

And here's the verbose log:

View::init()
cull()
cull() got SceneView 0x106510300
ShaderComposer::~ShaderComposer() 0x1c02d7450
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
draw() got SceneView 0x106510300
Renderer::compile()
State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
varying vec2 texcoord;
void main(void)
{
texcoord = gl_MultiTexCoord0.xy;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

++++++++
-------- Converted source
attribute vec4 osg_MultiTexCoord0;
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
varying vec2 texcoord;
void main(void)
{
texcoord = osg_MultiTexCoord0.xy;
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}

----------------

Compiling A :VERTEX source:
1: attribute vec4 osg_MultiTexCoord0;
2: attribute vec4 osg_Vertex;
3: uniform mat4 osg_ModelViewProjectionMatrix;
4: varying vec2 texcoord;
5: void main(void)
6: {
7: texcoord = osg_MultiTexCoord0.xy;
8: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
9: }

State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

++++++++
-------- Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

----------------

Compiling A :FRAGMENT source:
1: precision mediump float;
2: uniform sampler2D texture0;
3: varying vec2 texcoord;
4: void main(void)
5: {
6: gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
7: }

Linking osg::Program "BckProgram" id=3 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
Program "BckProgram" link succeeded, infolog:
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord7' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord5' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_SecondaryColor' 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_MultiTexCoord6' 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_Normal' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_Color' 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_MultiTexCoord2' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord3' to match BindAttributeLocation request.

Uniform "texture0" loc=4 size=1 type=sampler2D
Uniform "osg_ModelViewProjectionMatrix" loc=0 size=1 type=mat4
Attrib "osg_MultiTexCoord0" loc=3 size=1
Attrib "osg_Vertex" loc=0 size=1

Created new 0x1c41294c0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after stateset.compileGLObjects in GLObjectsVisitor::apply(osg::StateSet& stateset)
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x1063270e0
Setting up osg::Camera::FRAME_BUFFER
GLBufferObjectSet::GLBufferObjectSet _profile._size=80
Allocating new glBufferData(), _allocatedSize=80
2018-01-24 16:58:10.501060+0100 CameraCaptureExample[7697:6519318] deviceOrientationDidChange: 5
Created new 0x1c41296a0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Linking osg::Program "" id=4 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requi2018-01-24 16:58:10.503075+0100 CameraCaptureExample[7697:6519318] ...
res exactly one vertex and one fragment shader to validly link.

Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.


cull()
cull() got SceneView 0x106326740
ShaderComposer::~ShaderComposer() 0x1c02d74c0
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106326740
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x106327d30
Setting up osg::Camera::FRAME_BUFFER
2018-01-24 16:58:10.510586+0100 CameraCaptureExample[7697:6519318] ...
cull()
cull() got SceneView 0x106510300
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106510300
end draw() 0x1065101f0


After this the cull/draw calls repeat without errors.

Thank you!
Alessandro
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Wed Jan 24, 2018 4:56 pm    Post subject:
GLES link error for unidentified Program
Reply with quote

Hi Alessandro,

It's hard to know what is going on as we don't have the source you are
using, and I don't personally have iOS to test with.

The best I can say is that the OSG master and 3.4.1 now have inbuilt
shaders for text and stats so they now correctly appear without any
need to provide your own shaders like it used to be required.

I can't find any shader source in OpenSceneGraph-Data master or
OpenSceneGraph master that matches the lines in the shaders you've
posted so really can't guess where they have come from at this point.

Robert.

On 24 January 2018 at 16:18, Alessandro Terenzi <> wrote:
Quote:
Hi,
I used to work with OSG 3.4.0 (stable) and now I'm trying version 3.5.10 on iOS (trying both GLES 2 and 3) but now I having the following error when the first frame is drawn:

glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.

Note that I have only one quad to which I apply a texture, I'm using a single 'vertex' and 'fragment shader' and there's only on 'program' around. The same code works fine with OSG 3.4.0 and even though with version 3.5.10 there is the above error, the texture is nonetheless displayed.

If I use a more verbose notification level I see that my program "BckProgram" is compiled and linked correctly but then another program with empty name is tried to be linked and it is the one for which I'm receiving the above error, but I did not create a second program anywhere... am I missing something?

And here's the verbose log:

View::init()
cull()
cull() got SceneView 0x106510300
ShaderComposer::~ShaderComposer() 0x1c02d7450
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
draw() got SceneView 0x106510300
Renderer::compile()
State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
varying vec2 texcoord;
void main(void)
{
texcoord = gl_MultiTexCoord0.xy;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

++++++++
-------- Converted source
attribute vec4 osg_MultiTexCoord0;
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
varying vec2 texcoord;
void main(void)
{
texcoord = osg_MultiTexCoord0.xy;
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}

----------------

Compiling A :VERTEX source:
1: attribute vec4 osg_MultiTexCoord0;
2: attribute vec4 osg_Vertex;
3: uniform mat4 osg_ModelViewProjectionMatrix;
4: varying vec2 texcoord;
5: void main(void)
6: {
7: texcoord = osg_MultiTexCoord0.xy;
8: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
9: }

State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

++++++++
-------- Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

----------------

Compiling A :FRAGMENT source:
1: precision mediump float;
2: uniform sampler2D texture0;
3: varying vec2 texcoord;
4: void main(void)
5: {
6: gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
7: }

Linking osg::Program "BckProgram" id=3 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
Program "BckProgram" link succeeded, infolog:
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord7' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord5' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_SecondaryColor' 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_MultiTexCoord6' 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_Normal' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_Color' 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_MultiTexCoord2' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord3' to match BindAttributeLocation request.

Uniform "texture0" loc=4 size=1 type=sampler2D
Uniform "osg_ModelViewProjectionMatrix" loc=0 size=1 type=mat4
Attrib "osg_MultiTexCoord0" loc=3 size=1
Attrib "osg_Vertex" loc=0 size=1

Created new 0x1c41294c0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after stateset.compileGLObjects in GLObjectsVisitor::apply(osg::StateSet& stateset)
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x1063270e0
Setting up osg::Camera::FRAME_BUFFER
GLBufferObjectSet::GLBufferObjectSet _profile._size=80
Allocating new glBufferData(), _allocatedSize=80
2018-01-24 16:58:10.501060+0100 CameraCaptureExample[7697:6519318] deviceOrientationDidChange: 5
Created new 0x1c41296a0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Linking osg::Program "" id=4 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requi2018-01-24 16:58:10.503075+0100 CameraCaptureExample[7697:6519318] ...
res exactly one vertex and one fragment shader to validly link.

Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.

cull()
cull() got SceneView 0x106326740
ShaderComposer::~ShaderComposer() 0x1c02d74c0
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106326740
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x106327d30
Setting up osg::Camera::FRAME_BUFFER
2018-01-24 16:58:10.510586+0100 CameraCaptureExample[7697:6519318] ...
cull()
cull() got SceneView 0x106510300
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106510300
end draw() 0x1065101f0

After this the cull/draw calls repeat without errors.

Thank you!
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72854#72854








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
a.terenzi (Alessandro Terenzi)
Appreciator


Joined: 03 Sep 2009
Posts: 250

PostPosted: Wed Jan 24, 2018 5:50 pm    Post subject:
Reply with quote

Hi Robert,
I understand. What I'm doing is quite simple, just a quad with a texture that is updated every frame, I'm not using text or stats and I tried to write the scenegraph to disk in order to see if a second osg::Program were added somewhere but I just see the one I've created explicitly.

Just for your reference I'm attaching the osgt file that I saved while running the app (the smallest variant does not contain the image file and is very short).

Thanks.
Alessandro
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Thu Jan 25, 2018 9:43 am    Post subject:
GLES link error for unidentified Program
Reply with quote

Hi Alessandro,

I tested the models under my GL2 build of the OSG and the dump1.osgt
worked fine for me without any errors. I don't have time to test GLES
right now.

The vertex shader doesn't provide any hint for the precision, it might
be the the GLES drivers GLSL compiler is having an issue with that.

Also when targeting just GLES you always have to use the OSG's version
of gl_ModelViewMatrix, gl_Vertex etc, so you'll need to use
osg_ModelViewMatrix, osg_Vertex etc. The osg::State class will by
default be remapping these for you with the GLES2+ build so behind the
scenes this is being handled for you. While you should be aware that
this is happening, I don't think it's related to the issue you are
seeing. If you want to keep the shaders portable to GL2 then leaving
the gl_ModelViewMatrix in place is fine.

The master version of the OSG now provide support for inject
environmental values via osg::DisplaySettings::setValues(..), and
provides some defaults for these like OSG_GLSL_VERSION and
$OSG_PRECISSION_FLOAT tailored for the build type such as GL/GL3/GLES.
You can see this in action in the text.vert now in OpenSceneGraph-Data
master and OSG master (and recent dev release):

$OSG_GLSL_VERSION
$OSG_PRECISION_FLOAT

$OSG_VARYING_OUT vec2 texCoord;
$OSG_VARYING_OUT vec4 vertexColor;

void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
texCoord = gl_MultiTexCoord0.xy;
vertexColor = gl_Color;
}

It might be that it would be appropriate to use these to help with
future shaders to allow you to port between platforms easily.

Robert.

On 24 January 2018 at 16:18, Alessandro Terenzi <> wrote:
Quote:
Hi,
I used to work with OSG 3.4.0 (stable) and now I'm trying version 3.5.10 on iOS (trying both GLES 2 and 3) but now I having the following error when the first frame is drawn:

glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.

Note that I have only one quad to which I apply a texture, I'm using a single 'vertex' and 'fragment shader' and there's only on 'program' around. The same code works fine with OSG 3.4.0 and even though with version 3.5.10 there is the above error, the texture is nonetheless displayed.

If I use a more verbose notification level I see that my program "BckProgram" is compiled and linked correctly but then another program with empty name is tried to be linked and it is the one for which I'm receiving the above error, but I did not create a second program anywhere... am I missing something?

And here's the verbose log:

View::init()
cull()
cull() got SceneView 0x106510300
ShaderComposer::~ShaderComposer() 0x1c02d7450
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
draw() got SceneView 0x106510300
Renderer::compile()
State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
varying vec2 texcoord;
void main(void)
{
texcoord = gl_MultiTexCoord0.xy;
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}

++++++++
-------- Converted source
attribute vec4 osg_MultiTexCoord0;
attribute vec4 osg_Vertex;
uniform mat4 osg_ModelViewProjectionMatrix;
varying vec2 texcoord;
void main(void)
{
texcoord = osg_MultiTexCoord0.xy;
gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
}

----------------

Compiling A :VERTEX source:
1: attribute vec4 osg_MultiTexCoord0;
2: attribute vec4 osg_Vertex;
3: uniform mat4 osg_ModelViewProjectionMatrix;
4: varying vec2 texcoord;
5: void main(void)
6: {
7: texcoord = osg_MultiTexCoord0.xy;
8: gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex;
9: }

State::convertShaderSourceToOsgBuiltIns()
++Before Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

++++++++
-------- Converted source
precision mediump float;
uniform sampler2D texture0;
varying vec2 texcoord;
void main(void)
{
gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
}

----------------

Compiling A :FRAGMENT source:
1: precision mediump float;
2: uniform sampler2D texture0;
3: varying vec2 texcoord;
4: void main(void)
5: {
6: gl_FragColor = texture2D( texture0, vec2(texcoord.x, 1.0-texcoord.y));
7: }

Linking osg::Program "BckProgram" id=3 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
Program "BckProgram" link succeeded, infolog:
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord7' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord5' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_SecondaryColor' 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_MultiTexCoord6' 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_Normal' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_Color' 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_MultiTexCoord2' to match BindAttributeLocation request.
WARNING: Could not find vertex shader attribute 'osg_MultiTexCoord3' to match BindAttributeLocation request.

Uniform "texture0" loc=4 size=1 type=sampler2D
Uniform "osg_ModelViewProjectionMatrix" loc=0 size=1 type=mat4
Attrib "osg_MultiTexCoord0" loc=3 size=1
Attrib "osg_Vertex" loc=0 size=1

Created new 0x1c41294c0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after stateset.compileGLObjects in GLObjectsVisitor::apply(osg::StateSet& stateset)
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x1063270e0
Setting up osg::Camera::FRAME_BUFFER
GLBufferObjectSet::GLBufferObjectSet _profile._size=80
Allocating new glBufferData(), _allocatedSize=80
2018-01-24 16:58:10.501060+0100 CameraCaptureExample[7697:6519318] deviceOrientationDidChange: 5
Created new 0x1c41296a0 TextureObject, _numOfTextureObjects 1
Warning: detected OpenGL error 'invalid enumerant' at after RenderBin::draw(..)
Linking osg::Program "" id=4 contextID=0
State's vertex attrib binding 2, osg_Color
State's vertex attrib binding 12, 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 8, osg_MultiTexCoord5
State's vertex attrib binding 9, osg_MultiTexCoord6
State's vertex attrib binding 10, osg_MultiTexCoord7
State's vertex attrib binding 1, osg_Normal
State's vertex attrib binding 11, osg_SecondaryColor
State's vertex attrib binding 0, osg_Vertex
glLinkProgram 0x1c41cda70"" FAILED
Program "" infolog:
ERROR: OpenGL ES requi2018-01-24 16:58:10.503075+0100 CameraCaptureExample[7697:6519318] ...
res exactly one vertex and one fragment shader to validly link.

Program "" infolog:
ERROR: OpenGL ES requires exactly one vertex and one fragment shader to validly link.

cull()
cull() got SceneView 0x106326740
ShaderComposer::~ShaderComposer() 0x1c02d74c0
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
Uniform Adding parent
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106326740
OpenGL extension '' is not supported.
Adding parent0x1c02327e0
Adding parent0x1c02327e0
RenderStage::runCameraSetUp(osg::RenderInfo& renderInfo) 0x106327d30
Setting up osg::Camera::FRAME_BUFFER
2018-01-24 16:58:10.510586+0100 CameraCaptureExample[7697:6519318] ...
cull()
cull() got SceneView 0x106510300
end cull() 0x1065101f0
end draw() 0x1065101f0
draw() 0x1065101f0
draw() got SceneView 0x106510300
end draw() 0x1065101f0

After this the cull/draw calls repeat without errors.

Thank you!
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72854#72854








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
a.terenzi (Alessandro Terenzi)
Appreciator


Joined: 03 Sep 2009
Posts: 250

PostPosted: Thu Jan 25, 2018 4:19 pm    Post subject:
Reply with quote

Hi Robert,
and thanks again for your help and suggestions. I'm aware of the remapping done by OSG under the hood, indeed I had no issues with this when targeting GLES 2 with version 3.4.0.

I investigated my issue further and found out that a osg::Program is added to the scene graph by the StateSet::setGlobalDefaults() method which does something like this:

Code:
osg::DisplaySettings::ShaderHint shaderHint = osg::DisplaySettings::instance()->getShaderHint();
    if (shaderHint==osg::DisplaySettings::SHADER_GL3 || shaderHint==osg::DisplaySettings::SHADER_GLES3)
    {
        OSG_INFO<<"   StateSet::setGlobalDefaults() Setting up GL3 compatible shaders"<<std::endl;

        osg::ref_ptr<osg::Program> program = new osg::Program;
        program->addShader(new osg::Shader(osg::Shader::VERTEX, gl3_VertexShader));
        program->addShader(new osg::Shader(osg::Shader::FRAGMENT, gl3_FragmentShader));
        setAttributeAndModes(program.get());
        setTextureAttribute(0, createDefaultTexture());
        addUniform(new osg::Uniform("baseTexture", 0));
    }


this automatically added program is the one that fails while linking.

Now I'm trying to understand why it fails, but my question is: why is this program added? Is it supposed to provide a 'default' program in case there's nothing else in the scene graph? Can I avoid it to be added?

I'm also trying to understand where StateSet::setGlobalDefaults() is called in the first place...

Cheers,
Alessandro
Back to top
View user's profile Send private message
a.terenzi (Alessandro Terenzi)
Appreciator


Joined: 03 Sep 2009
Posts: 250

PostPosted: Thu Jan 25, 2018 6:05 pm    Post subject:
Reply with quote

I did some more tests, tried to remove that 'program' from StateSet::setGlobalDefaults () and I realised that, at last, that very program is really not tried to be linked at all (it looks like the attached shaders are not even compiled, but I'm not 100% sure).

So, I cannot say that the error comes from that 'program' in StateSet::setGlobalDefaults(), also because I tried to print the addresses of the 'program's being linked and I cannot track the origin of the one that fails to link...I also tried to get its attached shaders during the application loop but none is really attached to that program (calling getNumShaders() returns 0 on the 'program' that is not linked).

I think that what I am missing is a deeper understanding about what happens beyond the setup of the simple scene graph that I explicitly do with my code. Is there the possibility that OSG automatically creates a 'program' somewhere else beyond my explicit code? Any suggestion where to look? I tried to search for strings like "new osg::Program" or "getOrCreateProgram" but could not figure out anything yet...

Thanks.
Alessandro
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Thu Jan 25, 2018 6:06 pm    Post subject:
GLES link error for unidentified Program
Reply with quote

Hi Alessandro,

OK, this shader is a default provided to at least give something to
render. osg::DisplaySettings::ShaderHint is what controls the
addition of this fallback, in a GLES build it defaults to GLES2 or
GLES3, you can override this and switch it off via:

osg::DisplaySettings::instance()->setShaderHint(osg::DisplaySettings::SHADER_NONE);

The fallback shaders can be found at OpenSceneGraph/src/osg/StateSet.cpp.

Robert.


On 25 January 2018 at 16:19, Alessandro Terenzi <> wrote:
Quote:
Hi Robert,
and thanks again for your help and suggestions. I'm aware of the remapping done by OSG under the hood, indeed I had no issues with this when targeting GLES 2 with version 3.4.0.

I investigated my issue further and found out that a osg::Program is added to the scene graph by the StateSet::setGlobalDefaults() method which does something like this:


Code:
osg::DisplaySettings::ShaderHint shaderHint = osg::DisplaySettings::instance()->getShaderHint();
if (shaderHint==osg::DisplaySettings::SHADER_GL3 || shaderHint==osg::DisplaySettings::SHADER_GLES3)
{
OSG_INFO<<" StateSet::setGlobalDefaults() Setting up GL3 compatible shaders"<<std::endl;

osg::ref_ptr<osg::Program> program = new osg::Program;
program->addShader(new osg::Shader(osg::Shader::VERTEX, gl3_VertexShader));
program->addShader(new osg::Shader(osg::Shader::FRAGMENT, gl3_FragmentShader));
setAttributeAndModes(program.get());
setTextureAttribute(0, createDefaultTexture());
addUniform(new osg::Uniform("baseTexture", 0));
}



this automatically added program is the one that fails while linking.

Now I'm trying to understand why it fails, but my question is: why is this program added? Is it supposed to provide a 'default' program in case there's nothing else in the scene graph? Can I avoid it to be added?

I'm also trying to understand where StateSet::setGlobalDefaults() is called in the first place...

Cheers,
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72862#72862








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11802

PostPosted: Thu Jan 25, 2018 6:08 pm    Post subject:
GLES link error for unidentified Program
Reply with quote

Hi Alessandro,

I would recommend doing the tests on a desktop system and manually
select GLES builds, this should make it easier to go through the
various possibilities.

I would also recommend use git master if you aren't already. At least
that way if you come across bugs then we can get them fixed more
easily.

Also could you test some standard OSG examples to see what happens.

Robert.

On 25 January 2018 at 18:05, Alessandro Terenzi <> wrote:
Quote:
I did some more tests, tried to remove that 'program' from StateSet::setGlobalDefaults () and I realised that, at last, that very program is really not tried to be linked at all (it looks like the attached shaders are not even compiled, but I'm not 100% sure).

So, I cannot say that the error comes from that 'program' in StateSet::setGlobalDefaults(), also because I tried to print the addresses of the 'program's being linked and I cannot track the origin of the one that fails to link...I also tried to get its attached shaders during the application loop but none is really attached to that program (calling getNumShaders() returns 0 on the 'program' that is not linked).

I think that what I am missing is a deeper understanding about what happens beyond the setup of the simple scene graph that I explicitly do with my code. Is there the possibility that OSG automatically creates a 'program' somewhere else beyond my explicit code? Any suggestion where to look? I tried to search for strings like "new osg::Program" or "getOrCreateProgram" but could not figure out anything yet...

Thanks.
Alessandro

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=72863#72863








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Shader Program stops working after Ch... ceranco General 0 Mon May 21, 2018 3:09 pm View latest post
No new posts 'fatal error C1128: number of section... Jason Beverage General 2 Wed Apr 18, 2018 7:59 pm View latest post
No new posts osgQt Build error bclay General 2 Wed Jan 17, 2018 9:53 pm View latest post
No new posts Link error while build plugins gabriella seth General 3 Tue Jan 09, 2018 12:58 am View latest post
No new posts osg installation error rajani General 5 Thu Jan 04, 2018 5:43 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP