Texture.updateSubImage doesnot update the texture ...?

Hi All
I have got a texture , when the user zooms in i get a better resolution image and then replace the texture with the new image. the following is the code … but the texture replace returns without any effect , the texture is not replaced.
Please help
Thanks
Schiz

  my display method 

    Extents imgExtents = mbr.getImgExtents();
    Extents scrExtents = mbr.getScrExtents();
    // if(features.isReady())
    //  GLQueue.getInstance().add(features);
    GL gl = drawable.getGL();
    GLQueue.getInstance().execute(gl);

    
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    
    gl.glShadeModel(GL.GL_SMOOTH);

    
    texture.enable();
    
    texture.bind();
    
    gl.glTexEnvf(GL.GL_TEXTURE_ENV,GL.GL_TEXTURE_ENV_MODE,GL.GL_REPLACE);
    
    gl.glBegin(GL.GL_QUADS);
    
    gl.glTexCoord2d(imgExtents.myBottomX,imgExtents.myBottomY);
    gl.glVertex2d(scrExtents.myBottomX, scrExtents.myBottomY);
    
    gl.glTexCoord2d(imgExtents.myBottomX, imgExtents.myTopY);
    gl.glVertex2d(scrExtents.myBottomX,scrExtents.myTopY);
    
    gl.glTexCoord2d(imgExtents.myTopX, imgExtents.myTopY);
    gl.glVertex2d(scrExtents.myTopX, scrExtents.myTopY);
    
    gl.glTexCoord2d(imgExtents.myTopX, imgExtents.myBottomY);
    gl.glVertex2d(scrExtents.myTopX, scrExtents.myBottomY);
    gl.glEnd();
    
    
    texture.disable();
    texture.enable();
        texture.bind();
        ImagePool.getInstance().replace(texture);
    texture.disable();
    // features.execute(gl);
    
    drawable.swapBuffers();

the replace method

public void replace(Texture texture)
{
    if(data[curPos] == null || exts[curPos] == null)  return;
    System.out.println("Replacing ");
    MyConverter conv = IVContext.getContext().getWinToWorld();
    for(int i = 0 ; i < 3 ; i ++ )
    {
    if(exts[i] == null) continue;
    Extents temp = conv.toScreen(exts[i]);
     texture.updateSubImage(data[i], 0,(int)temp.getBottomX(),(int)temp.getBottomY());
    }

It looks to me like that code should work. Note that updateSubImage can’t update the actual allocated size of the Texture object, only a sub-rectangle of the existing Texture. Do you have a small test case which shows the problem? I believe updateSubImage has been tested fairly well and is actually used down the default Texture creation code path.

Hi Ken
I guess there may be a problem with size of the image. But anyways it shouldve given an error if size of the texture was a problem. Initial texture has an image of size 122 mb , then subsequently on zoom i get better resolution images from database and replace the corresponding part of the texture with it . I tried out by hardcoding some of the statements. i read an image from file , scaled it down (to reduce the size ) and did a updateSubImage on the loaded texture. Still there is no change in the texture. But this time when i zoom in, at certain zoom level i see the replaced texture becoming visible gradually on zooming, but has some transparency as i can still see the first image behind.
I am banking on this replace functionality of textures for my project , as creating new textures on the fly is slowing down my application.

Thanks in advance

schiz

If you are seeing problems could you please create a simplified test case (hopefully with a smaller data file than 122 MB) and file an issue with the JOGL Issue Tracker? As far as I know Texture.updateSubImage() is working fine.

Hi Ken
I am posting a Test code . I tested it with smaller images. These images are 2500 X 2500 pixels with each about 17 mb. Giving updateSubImage has no effect. But when i do setWidth, setHeight on the TextureData to 1000 X 1000 , then after zooming in for some level the new image is visible but that too is not correctly displayed. I am posting the code and also the snapshot of the application without zoom , and with zoom when the replaced texture is visible.

Thanks
schiz

Thanks for the test case but we really need a completely self-contained test case, including the appropriate images. Please don’t post it here, but open a bug using the JOGL Issue Tracker and attach a zip archive or similar of all of the files your test case needs. You will need to be an Observer of the JOGL project in order to properly file a bug.