Results 1 to 2 of 2

Thread: glTexSubImage2D and cube map texture

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    7

    glTexSubImage2D and cube map texture

    Hi,

    I am new to OpenGLES2 and wants to change part of image for a cube map texture.

    for eample - I want to change middle portion of old texture to new texturedata for all the cube faces.

    My code is somethig like -

    GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _POSITIVE_X, ilevel,eintformat,iWidth,iHeight,iBorder,eformat,e Type,TexData)); GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _NEGATIVE_X, ilevel,eintformat,iWidth,iHeight,iBorder,eformat,e Type,TexData));
    GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _POSITIVE_Y, ilevel,eintformat,iWidth,iHeight,iBorder,eformat,e Type,TexData));
    GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _NEGATIVE_Y, ilevel,eintformat,iWidth,iHeight,iBorder,eformat,e Type,TexData));
    GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _POSITIVE_Z, ilevel,eintformat,iWidth,iHeight,iBorder,eformat,e Type,TexData));
    GLES2_ERROR_CHECK(glTexImage2D(GL_TEXTURE_CUBE_MAP _NEGATIVE_Z,ilevel,eintformat,iWidth,iHeight,iBord er,eformat,eType,TexData));

    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_POSITIVE_X,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));
    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_NEGATIVE_X,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));
    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_POSITIVE_Y,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));
    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_NEGATIVE_Y,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));
    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_POSITIVE_Z,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));
    GLES2_ERROR_CHECK(glTexSubImage2D(GL_TEXTURE_CUBE_ MAP_NEGATIVE_Z,ilevel,iXoffset,iYoffset,isubwidth, isubheight,eformat,eType,subTexData));

    currently-iXoffset = iWidth/2 - isubwidth/2;
    iYoffset = iHeight/2 - isubheight/2 ;

    I am not getting the correct output on screen. I am getting the new texture not in the middle of the cube face. Am I doing something wrong in calculating the offsets?

    Thanks.

  2. #2
    Junior Member
    Join Date
    Oct 2010
    Posts
    7

    Re: glTexSubImage2D and cube map texture

    It was a simulator issue only. Problem solved.

Similar Threads

  1. video as texture on cube
    By Kabaj in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 1
    Last Post: 02-20-2013, 03:38 PM
  2. cube map textures.
    By HappyZappy in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 12-01-2010, 06:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •