Second: I have made an in-depth analysis and have tried many times to solve the issue by myself before asking here.
Let me clarify my problem:
I am trying to use gamekit as a game Engine. For those who do not know what gamekit is, it is an opensource game engine using ogre as rendering engine. For more info visit https://code.google.com/p/gamekit/
Now to the issue: gamekit is using librocket as UI library. The way librocket is by using a custom Ogre::RenderTargetListener to catch rendering events which it then forwards internaly to the library. The result is compiled geometry that is converted to Ogre compatible geometry or RenderOperation. Then the _render method is invoked from the appropriate RenderSystem (in my case it is Ogre::GLES2RenderSystem). All is good so far: librocket will give me the geometry and the textures, the appropriate conversion to Ogre RenderOperation will take place and then the render method will be invoked. However here the application crashes. The problem lies in
Code: Select all
void GLES2RenderSystem::_render(const RenderOperation& op)Code: Select all
GLSLESLinkProgram* linkProgram = GLSLESLinkProgramManager::getSingleton().getActiveLinkProgram();After some analysis I came to think that there are no active shaders for the rendering to be completed (since gles2 is using the programmable pipeline). This is when i tried to manually load some simple shaders and bind them. This is what I did:
Code: Select all
vertProg = Ogre::HighLevelGpuProgramManager::getSingleton().createProgram("SimpleTexturingNoLightsVP",
DEFAULT_ROCKET_RESOURCE_GROUP,
"glsles",
Ogre::GPT_VERTEX_PROGRAM);
vertProg->setSource(
"#version 100\n"
"void main(void) {\n"
"gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n"
"}\n");
vertProg->load();
fragProg = Ogre::HighLevelGpuProgramManager::getSingleton().createProgram("SimpleTexturingNoLightsFP",
DEFAULT_ROCKET_RESOURCE_GROUP,
"glsles",
Ogre::GPT_FRAGMENT_PROGRAM);
fragProg->setSource(
"#version 100\n"
"void main(void) {\n"
"gl_FragColor[0] = 0.0;\n"
"gl_FragColor[1] = 0.0;\n"
"gl_FragColor[2] = 1.0;\n"
"}\n"
);
fragProg->load();
Code: Select all
render_system->bindGpuProgram(vertProg->_getBindingDelegate());
render_system->bindGpuProgram(fragProg->_getBindingDelegate());
Now the application does not crash since there is the active link program, however nothing is drawn to the screen. For people that know this issue both the code used here will be familiar since part of it is actually found online as a possible solution to issue like this.
Are there any hints on what I should look at?
Another way to ask this question is how can i inherit the Ogre::RenderTargetListener and draw a simple cube in postRenderTargetUpdate method by calling Ogre::GLES2RenderSystem::_render method.
Thank You in advance,
Nikola T.