XShape example?

Carsten Haitzler (The Rasterman) raster at rasterman.com
Mon Oct 31 17:29:55 PST 2005


On Mon, 31 Oct 2005 15:33:12 +0100 Matthias Hopf <mhopf at suse.de> babbled:

> On Oct 29, 05 20:42:48 +1000, Russell Shaw wrote:
> > I've already tried doing drawing programs with client-side rendering.
> > The scrolling and zooming performance is complete and utter crap, just as
> > slow as doing all the graphics in gtk.
> 
> Then you're doing something wrong. OpenGL is faster than all 2D
> acceleration functions (and as CPU based code anyway). At least on
> halfway modern cards.
> 
> Perhaps you have been using the image pipeline (glCopyPixels) with pixel
> zoom != 1.0 or convolution or anything else activated. That is known to
> not be implemented efficiently on almost all OpenGL implementations.
> 
> As PixelZoom only does nearest neighbor lookup (eek!) you want to do
> something different: use glCopyTexSubImage2D to copy a framebuffer
> region to a texture, and draw a resized textured quad afterwards.
> 
> > > opengl is quite "iffy" for 2d - especcially if u want to use textures on
> > > pilys for replacements of pixmaps - different ogl implementations will
> > > round texture co-ords diddfernly so u may not end up with precisely the
> > > same output on every driver - and sometimes the output is less than
> > > desireable.
> 
> Not true. There are specific offsets that - together with nearest
> neighbor interpolation - are pixel exact on every platform.

let me know what they are!. seriously. try nvidia's opengl vs. DRI based opengl
on i8xx - and use mipmapped textures for 2d gfx and scaling - and now since you
are stuck with texture-coords 0.0-1.0 and your image is 343x246 so you have
been forced to use s 512x256 texture and thus need to adjust your tex coords to
max out at like 0.669921875 and 0.9609375 at the quad bottom-right, but even if
you do thsi - with double precision math, it blurrs when rendering 1:1 (draw
quad with integer verticies so its the right size (0,0, 342,0 342,245 0,245),
but texture is all blurry - on i8xx, but on nvidia its clear and correct). now
if u move to using nv/ect rectangle textures it works fine, but you lose any
form of downscaling filtering - so you use npot textures and ansiotropic
filterign and you are back to the blurry mipmap case. all the "accurate" 2d
rendering code i've seen using opengl uses rectangle textures - these seem to
work - but you lose out on downscaling - and man it sucks. :( 

> > The only way to get snappy zooming and scrolling in a drawing program
> > is to use OpenGL display lists.
> 
> I wonder what display lists would help here. You don't have much data
> transfer over the bus. If you have, you do something wrong.
> 
> Or I completely misread you.
> 
> Matthias
> 
> -- 
> Matthias Hopf <mhopf at suse.de>       __        __   __
> Maxfeldstr. 5 / 90409 Nuernberg    (_   | |  (_   |__         mat at mshopf.de
> Phone +49-911-74053-715            __)  |_|  __)  |__  labs   www.mshopf.de
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com
裸好多
Tokyo, Japan (東京 日本)



More information about the xorg mailing list