use setResizeNonPowerOfTwoHint(false) on your texture
or use TextureRectangle instead of Texture2D

Cheers

02.03.2012, 06:41, "Michael Schanne" <[email protected]>:
> Thanks for the responses.
>
> Using a PixelBufferObject did not appear to make any difference in 
> performance for me.  My video hardware only supports OpenGL 1.5, so that is 
> probably the reason.
>
> I suspect the power of two issue is the cause of my performance problem.  
> When I create a 640x480 image I get a console message that it is being scaled 
> to 512x512.  However, when I try to create a 512x512 image instead, I get an 
> error message "Detected OpenGL error 'invalid enumerant' at After 
> Renderer::compile".  This is before I even attempt to load any video data 
> into the image.  What does this error mean?
>
> Here is the code:
>
> int pixelsX = 640;
> int pixelsY = 480;
> int bytesPerPixel = 4;
>
> rawData = new unsigned char[pixelsX * pixelsY * bytesPerPixel];
> memset(rawData, 0xFF, (pixelsX * pixelsY * bytesPerPixel));
>
> setImage(
>         pixelsX,                // width
>         pixelsY,                // height
>         1,                      // depth
>         GL_RGB8,                 // internal texture format
>         GL_BGRA,                 // pixel format
>         GL_UNSIGNED_INT_8_8_8_8, // data type
>         rawData,                // raw data
>         osg::Image::NO_DELETE); // memory allocation mode
>
> Using 640x480 (which gets scaled to 512x512) I get a white quad, as I expect. 
>  However, if I use 512x512 image, I see distorted green lines with a black 
> background on the quad, along with the error.  If I try to load any video 
> data at this point, the program crashes.
>
> I also have the option of using a video frame of 8 bits per pixel (for a 
> greyscale image) but I have not been able to see the image at all in that 
> case.  I tried using the GL_LUMINANCE pixel format and GL_UNSIGNED_BYTE data 
> type, along with a few other combinations, but nothing has worked so far.
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=45956#45956
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to