glDrawPixels.

New Message Reply Date view Thread view Subject view Author view

Steve Baker (steve++at++mred.bgm.link.com)
Fri, 31 Jan 97 15:50:50 -0500


<RANT>
Never again - NEVER, NEVER!!! It serves me right - I should have stuck
with Performer - but Noooo - I had to go and write a RAW OpenGL program.
</RANT>

For those who have not been following this thread - I have a *VERY* simple OpenGL
program that just does a single glDrawPixels() in a loop.

It ought to run faster than 60Hz - it actually runs at 13Hz.

Many kind people suggested that I use GL_UNSIGNED_BYTES as the data format
and GL_RGB/RGBA/ABGR as the colour organization...I was already doing that
(it's IMPORTANT!).

Even more kind people gave me long lists of glDisable's to add to the dozen
or so that I already have. Also very important - also made no difference.

So I go web surfing - YAHOO came up with ~90 references to glDrawPixels,
almost all of which were either about Mesa (a really nice freeware OpenGL
clone) - were the man page for glDrawPixels, or were copies of the SGI FAQ entry:

    "Why is OpenGL's glDrawPixels slower than IrisGL's lrectwrite?"

   ...by Allen Akin. (It says the same things as above - watch your byte ordering
   and watch the glDisable's).

However, by some flook of YAHOO's search engine, right at the bottom of that
list of documents was:

  http://www.andromeda.com/people/ddyer/opengl.html

Who says:-

> Bug in "Libtk" makes opengl 30% slower than "gl"
>
> I've seen this question several times:
>
> > We'd like to start using OpenGL for our graphics programming, but
> > it seems to be a lot slower than GL. For instance, glDrawPixels
> > appears to be about 30% slower than GL's lrectwrite. Which means
> > that it's too slow for us. This is on an SGI Indy(R4600) running IRIX
> > 5.3. Is there any way to get the same performance out of OpenGL that
> > we get out of GL?
>
> There are at least two versions of libtk for the SGI floating around,both distributed from
> sgigate.sgi.com. The "bad" version is bundledin sgigate.sgi.com
> pub/opengl/contrib/opengl.tar.Z, The "other" (maybegood, I don't know) copy is from
> pub/opengl/contrib/libtk.tar.Z
>
>
> lido 143 % diff tk.h tk.h.~1~
> 76,77c76,77
> --- /* bad version */
> #define TK_IS_DIRECT(x) (((x) & TK_INDIRECT) == 0)
> #define TK_IS_INDIRECT(x) (((x) & TK_INDIRECT) != 0)
> --- /* good version */
> #define TK_IS_DIRECT(x) (((x) & TK_INDIRECT) != 0)
> #define TK_IS_INDIRECT(x) (((x) & TK_INDIRECT) == 0)

Well - being a X11-ophobe, I was using libaux to open my OGL windows - and it looks
like it has the same bug as libtk (maybe they sometimes cancel each other out).

When I mailed this, my frame rate shot up to 60Hz - the speedup is probably more
than 4x since I'm now limited by the frame rate.

Boy - it's a big scary world outside of cosy, warm Performer-land isn't it!

Thanks to everyone who helped.

   Steve

Steve Baker 817-619-1361 (Vox-Lab)
Hughes Training Inc. 817-619-8776 (Vox-Office/Vox-Mail)
2200 Arlington Downs Road 817-619-4028 (Fax)
Arlington, Texas. TX 76005-6171 Steve++at++MrEd.bgm.link.com (eMail)
http://www.hti.com (external) http://MrEd.bgm.link.com/staff/steve (intranet)
                                http://web2.airmail.net/sjbaker1 (external)

"You can't destroy the Earth - that's where I keep all my stuff!" - The Tick.

=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
            Submissions: info-performer++at++sgi.com
        Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:31 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.