Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Windows 64bit > OpenGL works slow without graphics drivers, and also in Virtual Machines (VMWare) ?

Reply
Thread Tools

OpenGL works slow without graphics drivers, and also in Virtual Machines (VMWare) ?

 
 
Skybuck Flying
Guest
Posts: n/a
 
      07-17-2011
Actually I remember there was only one rectangle being drawn (before that a
clear) so it's definetly not a case of to much stuff to render, which leaves
one last possibility, some kind of strange bug in the opengl software driver
?! (Or the clear is causing the slow down)

Bye,
Skybuck.

 
Reply With Quote
 
 
 
 
Skybuck Flying
Guest
Posts: n/a
 
      07-17-2011
What makes you believe that the documentation will help me ?

Bye,
Skybuck.
 
Reply With Quote
 
 
 
 
Skybuck Flying
Guest
Posts: n/a
 
      07-17-2011
Ok,

I took a lazy approach and simply disabled some open api calls which were
probably queueing opengl commands.

Then I started to get a hunch for what the problem was:

It turns out the "double" buffering is causing a major slowdown:

When mOptionDoubleBufferEnabled is set to true, things become extremely
slow.

When mOptionDoubleBufferEnabled is set to false, everything runs faster, but
the drawing starts to flicker

I don't think GDI would flicker that much... this means opengl software
driver just sucks compared to gdi.

// if double buffering is enabled then draw to backbuffer
if mOptionDoubleBufferEnabled then
begin
mOpenGLAPI.glDrawBuffer( GL_BACK );
end else
// else draw to front buffer
begin
mOpenGLAPI.glDrawBuffer( GL_FRONT );
end;

.... opengl draw codes...

// if double buffering is enabled then we still need to copy it to the
front buffer
if mOptionDoubleBufferEnabled then
begin
mOpenGLAPI.glReadBuffer( GL_BACK );
mOpenGLAPI.glDrawBuffer( GL_FRONT );
mOpenGLAPI.glCopyPixels( 0, 0, ClientWidth, ClientHeight, GL_COLOR);
end;

mOpenGLAPI.glFlush;

Bye,
Skybuck.

 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      07-17-2011
A possible solution could be to:

// glCopyPixels not used this api any more as it seems the cause of the slow
down.

// glFlush perhaps also leave this out.

And instead use:

SwapBuffers( Canvas.Handle ); // windows api call.

From what I can remember I didn't like this solution at first because this
limits the rendering speed of opengl to 60 hz or so... or it adds some
milliseconds of waiting time.

As I wanted to use the same code for gpgpu or so.... I didn't want this 60
hz limitation/retrace limitation.

But it seems this has to be used for slower systems.

Swapping the buffers instead of copieing the pixels makes sense... I can
imagine the swap buffer call to simply swap some pointers here and there.

The performance is much better, and double buffering can be used so no more
blinking.

Even when double buffering is off it seems to work, not yet sure why... and
no flicker so far.

It's note worthy to note that previous method was faster for single
buffering but produced unwanted flicker.

I am not sure if the ReadBuffer call and the DrawBuffer call are still
needed. From what I remember these specify the source and dest buffer for
the glCopyPixels call, so these calls can probably be left out.

I can vaguely remember SwapBuffers to work with two buffers always... it
seems to make sense... one offline and one online buffer... so any other
buffer calls probably not needed when using this api.

Well now I know how to fix my application so it runs on "default windows"
with acceptable speed and no flicker...

Bye,
Skybuck.

 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      07-17-2011
Ofcourse I should still make sure GDI is supported as well and can be switch
to for safe heaven...

Because ya never know... opengl could have more unpleasent surprises ! =D

Bye,
Skybuck =D

 
Reply With Quote
 
Quadibloc
Guest
Posts: n/a
 
      07-17-2011
What you state in the title should come as no surprise.

OpenGL and Direct X both provide graphics-intensive programs with a
standardized interface for doing things applicable, for example, to 3D
animation.

This replaces having to write those programs only to work with the
graphics acceleration on one particular video card - or with modules
for all the different video cards.

So, if you don't have the drivers, if you are inside a virtual machine
which has just a plain Super VGA card without acceleration, your
OpenGL driver has to do all the computational work itself, without
making use of the graphics acceleration features of your video card.
As you've observed, this causes a major slowdown.

Profiling is not the answer. The answer is to either get the drivers,
or have one's virtualization software pass through the type of video
card you actually have - select that video card in one's virtual
machine, and ensure that the virtualization software handles it by a
pass-through.

John Savard
 
Reply With Quote
 
fungus
Guest
Posts: n/a
 
      07-17-2011
On Jul 17, 9:53*am, "Skybuck Flying" <Windows7I...@DreamPC2006.com>
wrote:
> What makes you believe that the documentation will help me ?
>


Well ... It usually helps *me* when I read it (which
I often do)

 
Reply With Quote
 
Leclerc
Guest
Posts: n/a
 
      07-17-2011
>> What makes you believe that the documentation will help me ?
>>

>
> Well ... It usually helps *me* when I read it (which
> I often do)
>


I don't know whether it is a rule or exception, but reading docs helps
me as well ...
 
Reply With Quote
 
David
Guest
Posts: n/a
 
      07-17-2011
"Skybuck Flying" wrote in message
news:7190d$4e2294fd$5419acc3$ b.home.nl...

What makes you believe that the documentation will help me ?

Bye,
Skybuck.

You see this is why I don't block this guy, some of his comments are
hilarious.

Almost worth quoting that one.

Thanks Skybuck

 
Reply With Quote
 
fungus
Guest
Posts: n/a
 
      07-17-2011
On Jul 17, 7:06*pm, "David" <quietman1...@hotmail.com> wrote:
>
> You see this is why I don't block this guy, some of his comments are
> hilarious.
>


Yep.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much)have a look at my blog site for asp.net .. there is microsoft contest also ( u can win so much) justpratik Python 0 06-08-2007 04:48 AM
Re: UPDATE: They didn't only pledge allegiance to Mex flag: anchor babies in TX *also* shouted "RAZA! RAZA!" in US school also tedorn44@hotmail.com Digital Photography 9 10-21-2006 11:12 AM
virtual machines and virtual labs/simulations jpersona MCSA 8 04-12-2005 01:34 AM
If declared as virtual in base, its derived version also is virtual. Why not for destructors? qazmlp C++ 7 07-27-2004 03:10 PM
Spinning OpenGL.Tk graphics Michael Peuser Python 1 07-22-2003 10:36 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57