Hint to implement OpenGL cubemap support?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Hint to implement OpenGL cubemap support?

Post by mant »

I add this code:

Code: Select all

 
bool COpenGLSLMaterialRenderer::setCubeMapSamplerFaces(const c8* name, ITexture** faces) {
#if defined(GL_VERSION_2_0)||defined(GL_ARB_shader_objects)
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
    glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
 
    for(int i = 0; i < 6; ++i)
    {
        ITexture* tex = faces[i];
 
        glTexImage2D(
            GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 
            0, GL_RGB, tex->getSize().Width, tex->getSize().Height, 0, GL_RGB, GL_UNSIGNED_BYTE, tex->lock()
        );
        tex->unlock();
    }
    return true;
#else
    return false;
#endif
}
 
and use in the callback as:

Code: Select all

 
services->setCubeMapSamplerFaces("cube", faces); // faces has been set in another function (non-override) of the callback and they're render target's textures
 
but when I run, the logger shows repeatedly:

Code: Select all

 
GL_INVALID_VALUE
Could not bind Texture
 
Anyone has done OpenGL cubemap for Irrlicht before?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Hint to implement OpenGL cubemap support?

Post by CuteAlien »

Sorry, I didn't. On which platform are you?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
mant
Posts: 125
Joined: Sun Jan 27, 2013 3:38 pm

Re: Hint to implement OpenGL cubemap support?

Post by mant »

I'm on linux. Btw I notice that there's OpenGL cubemap feature in Irrlicht 1.9 (svn trunk), but there are some API not compatible with 1.8. How is 1.9 development going? Is it near to the release?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Hint to implement OpenGL cubemap support?

Post by CuteAlien »

Yeah, it has some changes. And no - release not close. Merging OGL branch still biggest todo. I wanted to merge it last weeks when I had some holiday, but run into some troubles with that branch and gave up (and did non-Irrlicht stuff instead) :-(. Will give it another shot some day, but not expecting release soon.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply