Hi Robert,

Robert Osfield wrote:
Hi J.P,

On Wed, Oct 7, 2009 at 11:26 AM, J.P. Delport <jpdelp...@csir.co.za> wrote:
just some more comments...

I've compared code for
Texture::applyTexImage2D_subload
vs
TextureRectangle::applyTexImage_subload

in the former the result of pbo->getOffset() is never used.

If in TextureRectangle::applyTexImage_subload I leave dataPtr to point to
the image data, it runs the same as --texture2D, i.e.

Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,)

Could you pinpoint the code you are referring to?  Copying and pasting
into an email would be fine, or even line numbers might be OK if you
are working against svn/trunk.

In Texture::applyTexImage2D_subload Texture.cpp line 2064

 glTexSubImage2D( target, 0,
                0, 0,
                inwidth, inheight,
                (GLenum)image->getPixelFormat(),
                (GLenum)image->getDataType(),
                data - dataMinusOffset + dataPlusOffset);

is called with "data"

line 1987
unsigned char* data = (unsigned char*)image->data();

line 2035, still same function...
const unsigned char* dataPtr = image->data();
    GLBufferObject* pbo = image->getOrCreateGLBufferObject(contextID);
    if (pbo && !needImageRescale && !useGluBuildMipMaps)
    {
        state.bindPixelBufferObject(pbo);
dataPtr = reinterpret_cast<unsigned char*>(pbo->getOffset(image->getBufferIndex()));

dataPtr is set here, but not used at all further in the function.

If you compare this with TextureRectangle::applyTexImage_subload you will see that dataPtr is set and used there.

So, osgmovie --texture2D now still gives corrupted images, even with the BufferObject fix applied. It used to work because the binding failed.

Hope I explained better.

jp


Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. MailScanner thanks Transtec Computers for their support.

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to