[Qt-interest] QGLWidget drawing BIG images "problem"

Samuel Rødal sroedal at trolltech.com
Mon Feb 23 17:51:31 CET 2009


Mihail Naydenov wrote:
> Its well know there is a texture limit for the size that OpenGL can draw. And this limit varies based on the specific video card and amount of vram.
> 
> Right now there seams to be no reliable way to draw an image using the standard ways, like adding a QGraphicsPixmapItem to QGraphicsView with QGLWidget for surface, or just calling drawPixmap in QGLWidget derived widget - this is without using OpenGL directly.
> If the image is to big for the video to handle its just not drawn, and there is no way to tell if it will show or not! (again without low-level ogl hackery)
> 
> Im interested if this problem will be faced, and how.
> 
> There could be some way to test if the tex is to big so the user can switch to sw rendering
> 
> Also the vary best solution will be to have the so called "texture slicing" were the big tex (image) is sliced into many smaller ones, that are within the video limits, so that all combined represent the original image
> 
> Thank You
> MihailNaydenov

Hi,

QOpenGLPaintEngine::drawPixmap() and drawImage() have checks in place to 
see whether the dimensions exceed the max texture size. If so, the 
image/pixmap is scaled down to the max texture size. Note this is not an 
ideal situation since scaling is quite expensive and the image/pixmap 
won't be cached as a texture any more, but at least it's better than 
just failing to draw the image.

The use case isn't really common enough to justify the extra complexity 
caused by texture slicing, especially considering that the max texture 
size is typically 4096x4096 or even 8192x8192 on newer cards.

Regards,
Samuel



More information about the Qt-interest-old mailing list