Hello to all,
I am trying to port some methods of a pure openGL/Glsl project in a
OpenSG one. In the OpenGL part, i will write some texture usign Multi
Render Target and GLSL. Those textures have been created and used in the
following way:
//generating and attached the shader
glGenFramebuffersEXT(&m_fbObject);
glGenTextures(1, &m_texFBO_1);
glGenTextures(1, &m_texFBO_2);
glGenTextures(1, &m_texFBO_3);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbObject);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_RECTANGLE_ARB, m_texFBO_1, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,
GL_TEXTURE_RECTANGLE_ARB, m_texFBO_2, 0);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT2_EXT,
GL_TEXTURE_RECTANGLE_ARB, m_texFBO_3, 0);
....
glDrawBuffersARB(3, mrt);
...
// run the GLSL shader
..
//set the texture as input to the next OpenSG shader
glActiveTexture(GL_TEXTURE12);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_texFBO_1);
glActiveTexture(GL_TEXTURE13);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_texFBO_2);
glActiveTexture(GL_TEXTURE14);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, m_texFBO_3);
...
// OpenSG Shader
beginEditCP(m_shader);
....
m_shader->setUniformParameter("m_texFBO_1", (int)12);
m_shader->setUniformParameter("m_texFBO_2", (int)13);
m_shader->setUniformParameter("m_texFBO_3)", (int)14);
....
endEditCP(m_shader);
The OpenSG shader has been correctly attached.
Is this a correct way for passing texture from openGL to OpenSG if it is
supposed to be possible? (i read that is not a good idea to mix them...).
The problem is that the OpenSG shader do not "always" seems to read the
correct value from the texture and so it do not work properly.
The OpenGL context and the OpenSG one are the same.
Any clue about it?
Thank you!
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users