OpenGL and Hardware acceleration?

OpenGL and Hardware acceleration?

Post by Oleg Igna » Sat, 28 Jun 2003 14:32:30



  Hi all,
  I got a sort of problem. Whatever program that uses OpenGL i write, i
works slower then the same under Direct3D. It makes me think that GL is a
software rendering implementation, ain't it? If anyone could help me,
please, don't hesitiate...

Thanks on before,
  Oleg

 
 
 

OpenGL and Hardware acceleration?

Post by Roger Rowlan » Fri, 27 Jun 2003 15:48:07


Under Windows, there *is* a default software rendering implementation. If
your graphics card implements hardware accelerated gl calls (most do), then
this will normally take over without you having to code any differently.

One thing to watch out for is the use of PFD_DRAW_TO_BITMAP when you set the
pixel format. If you use this, you will *always* drop into the software
renderer, no matter what gfx card you have.


Quote:>   Hi all,
>   I got a sort of problem. Whatever program that uses OpenGL i write, i
> works slower then the same under Direct3D. It makes me think that GL is a
> software rendering implementation, ain't it? If anyone could help me,
> please, don't hesitiate...

> Thanks on before,
>   Oleg


 
 
 

OpenGL and Hardware acceleration?

Post by Alex Mizrah » Sat, 28 Jun 2003 06:31:10


Hello, Oleg!
You wrote  on Fri, 27 Jun 2003 08:32:30 +0300:

 OI>   I got a sort of problem. Whatever program that uses OpenGL i
 OI> write, i works slower then the same under Direct3D. It makes me
 OI> think that GL is a software rendering implementation, ain't it? If
 OI> anyone could help me, please, don't hesitiate...

if OpenGL is significantly slower than d3d you can:
1)have hardware that supports d3d but not ogl. such hardware is rare and
ancient.
2)have some broken ogl drivers
3)have some bug in program(wrong initialization) - try also programs that
are written not by you.

With best regards, Alex Mizrahi aka killer_storm.

 
 
 

OpenGL and Hardware acceleration?

Post by fungu » Sat, 28 Jun 2003 07:05:00



>   Hi all,
>   I got a sort of problem. Whatever program that uses OpenGL i write, i
> works slower then the same under Direct3D. It makes me think that GL is a
> software rendering implementation, ain't it?

No, OpenGL is as fast as Direct3D. If it goes much slower on
your machine then it's a problem with your graphics card
or driver.

Try downloading and installing the latest drivers from
the web site of whoever makes your graphics card.

--
<\___/>          For email, remove my socks.
/ O O \
\_____/  FTB.    Why isn't there mouse-flavored cat food?

 
 
 

OpenGL and Hardware acceleration?

Post by Shad Dero » Mon, 30 Jun 2003 02:28:03


Hello, Roger!
You wrote  on Thu, 26 Jun 2003 07:48:07 +0100:

[...]
RR> One thing to watch out for is the use of PFD_DRAW_TO_BITMAP when
RR> you set the pixel format. If you use this, you will *always* drop
RR> into the software renderer, no matter what gfx card you have.

I've tried to add PFD_DRAW_TO_BITMAP in PIXELFORMATDESCRIPTOR, but I
haven't obtained a different performance from the usual, so now I wonder
if my rendering is HW accelerated.
My performance is 23 fps, with 100 md2 models of 800-900 triangles (2
MTps).
I use the immediate mode and the optimizations of md2 models (so I
render triangle strips or triangle fans).
With displaylist the performance is 27 fps (15%-18% more than the
immediate mode).
I have a PentiumIV 1.5 GHz, an ATI RV-100 (32MB) and my os is WinME.
This performance "sounds" like HW or SW rendering?
This is the PIXELFORMATDESCRIPTOR  initialization:

/***************** Code : Begin ****************/
 static PIXELFORMATDESCRIPTOR pfd=
 {
  sizeof(PIXELFORMATDESCRIPTOR),
  1,
  PFD_DRAW_TO_WINDOW |
  PFD_SUPPORT_OPENGL |
  PFD_GENERIC_ACCELERATED|
  PFD_DOUBLEBUFFER|
  PFD_DRAW_TO_BITMAP|   // Test for SW-HW rendering
  PFD_GENERIC_FORMAT,
  PFD_TYPE_RGBA,
  16,
  0, 0, 0, 0, 0, 0,
  0,
  0,
  0,
  0, 0, 0, 0,
  24,
  0,
  0,
  PFD_MAIN_PLANE,
  0, 0, 0, 0
 };

/**************** Code : End ***********/

Furthermore, even if I set PFD_GENERIC_ACCELERATED in
PIXELFORMATDESCRIPTOR, when i use:

 /*************** Code : Begin ****************/
 // Detect hardware/software acceleration type.
 PIXELFORMATDESCRIPTOR pfd_new;
 if (DescribePixelFormat (hDC,
PixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd_new)==0)
  {
    MessageBox(NULL, "Error", "OpenGL Information", MB_ICONERROR|MB_OK);
  };

 int generic_format = pfd_new.dwFlags & PFD_GENERIC_FORMAT;
 int generic_accelerated = pfd_new.dwFlags & PFD_GENERIC_ACCELERATED;

 if(generic_format && !generic_accelerated)
  MessageBox(NULL, "Software only", "OpenGL Information",
MB_ICONINFORMATION|MB_OK);

 else if(generic_format && generic_accelerated)
  MessageBox(NULL, "MCD Acceleration", "OpenGL Information",
MB_ICONINFORMATION|MB_OK);

 else if(!generic_format && !generic_accelerated)
  MessageBox(NULL, "ICD Acceleration", "OpenGL Information",
MB_ICONINFORMATION|MB_OK);
 /*************** Code : End ****************/

I obtain always  "ICD acceleration". Is this normal?

Finally:
 *  glGetString(GL_VENDOR) returns "ATI..."
 *  glGetString(GL_RENDERER) returns "RADEON..."
 *  glGetString(GL_VERSION) returns "1.2.2204 Win9x Release"
 *  glGetString(GL_EXTENSIONS) returns a lot of GL_ARB and GL_EXT
extensions
so  I guess I could get the HW rendering.

I hope my english is not too bad. ^_^;

Bye, Shad Derow.

 
 
 

OpenGL and Hardware acceleration?

Post by Shad Dero » Mon, 30 Jun 2003 03:14:27


I wrote  on Sat, 28 Jun 2003 17:28:03 GMT:

[...]
 SD> My performance is 23 fps, with 100 md2 models of 800-900 triangles
 SD> (2 MTps).
 SD> I use the immediate mode and the optimizations of md2 models (so I
 SD> render triangle strips or triangle fans).
 SD> With displaylist the performance is 27 fps (15%-18% more than the
 SD> immediate mode).
 SD> I have a PentiumIV 1.5 GHz, an ATI RV-100 (32MB) and my os is
 SD> WinME. This performance "sounds" like HW or SW rendering?
[...]

Oh, I forgot...
I've disabled all (light, ...), but I've enabled texture2d (the models
are texturized) and smooth.
The glBindTexture(GL_TEXTURE_2D, ...) is called only few (3-4) times;
anyway, even if I disable the texturization, I get no more fps.

 
 
 

OpenGL and Hardware acceleration?

Post by Roger Rowlan » Mon, 30 Jun 2003 03:42:50


Well from your post it looks like you *are* getting accelerated GL. I guess
the thing to do is check whether or not the pixel format you get *does*
actually support PFD_DRAW_TO_BITMAP? I've always believed (and seen it
confirmed many times on newsgroups) that this is a s/w renderer option only.

It could be that, although you request it, the pixel format you get from
ChoosePixelFormat ignores the s/w version in favour of t5he other flags you
asked for.

Instead of your existing code, try -

int bmp_format = pfd_new.dwFlags & PFD_DRAW_TO_BITMAP;
int generic_accelerated = pfd_new.dwFlags & PFD_GENERIC_ACCELERATED;

if(bmp_format && !generic_accelerated)
  MessageBox(NULL, "Software only", "OpenGL Information",
 MB_ICONINFORMATION|MB_OK);

If you *do* manage to get accelerated GL with bmp output supported - please
post details of your gfx card and driver versions!

Best regards,
Roger

PS - Your english is fine :-))


Quote:> Hello, Roger!
> You wrote  on Thu, 26 Jun 2003 07:48:07 +0100:

> [...]
> RR> One thing to watch out for is the use of PFD_DRAW_TO_BITMAP when
> RR> you set the pixel format. If you use this, you will *always* drop
> RR> into the software renderer, no matter what gfx card you have.

> I've tried to add PFD_DRAW_TO_BITMAP in PIXELFORMATDESCRIPTOR, but I
> haven't obtained a different performance from the usual, so now I wonder
> if my rendering is HW accelerated.
> My performance is 23 fps, with 100 md2 models of 800-900 triangles (2
> MTps).
> I use the immediate mode and the optimizations of md2 models (so I
> render triangle strips or triangle fans).
> With displaylist the performance is 27 fps (15%-18% more than the
> immediate mode).
> I have a PentiumIV 1.5 GHz, an ATI RV-100 (32MB) and my os is WinME.
> This performance "sounds" like HW or SW rendering?
> This is the PIXELFORMATDESCRIPTOR  initialization:

> /***************** Code : Begin ****************/
>  static PIXELFORMATDESCRIPTOR pfd=
>  {
>   sizeof(PIXELFORMATDESCRIPTOR),
>   1,
>   PFD_DRAW_TO_WINDOW |
>   PFD_SUPPORT_OPENGL |
>   PFD_GENERIC_ACCELERATED|
>   PFD_DOUBLEBUFFER|
>   PFD_DRAW_TO_BITMAP|   // Test for SW-HW rendering
>   PFD_GENERIC_FORMAT,
>   PFD_TYPE_RGBA,
>   16,
>   0, 0, 0, 0, 0, 0,
>   0,
>   0,
>   0,
>   0, 0, 0, 0,
>   24,
>   0,
>   0,
>   PFD_MAIN_PLANE,
>   0, 0, 0, 0
>  };

> /**************** Code : End ***********/

> Furthermore, even if I set PFD_GENERIC_ACCELERATED in
> PIXELFORMATDESCRIPTOR, when i use:

>  /*************** Code : Begin ****************/
>  // Detect hardware/software acceleration type.
>  PIXELFORMATDESCRIPTOR pfd_new;
>  if (DescribePixelFormat (hDC,
> PixelFormat,sizeof(PIXELFORMATDESCRIPTOR), &pfd_new)==0)
>   {
>     MessageBox(NULL, "Error", "OpenGL Information", MB_ICONERROR|MB_OK);
>   };

>  int generic_format = pfd_new.dwFlags & PFD_GENERIC_FORMAT;
>  int generic_accelerated = pfd_new.dwFlags & PFD_GENERIC_ACCELERATED;

>  if(generic_format && !generic_accelerated)
>   MessageBox(NULL, "Software only", "OpenGL Information",
> MB_ICONINFORMATION|MB_OK);

>  else if(generic_format && generic_accelerated)
>   MessageBox(NULL, "MCD Acceleration", "OpenGL Information",
> MB_ICONINFORMATION|MB_OK);

>  else if(!generic_format && !generic_accelerated)
>   MessageBox(NULL, "ICD Acceleration", "OpenGL Information",
> MB_ICONINFORMATION|MB_OK);
>  /*************** Code : End ****************/

> I obtain always  "ICD acceleration". Is this normal?

> Finally:
>  *  glGetString(GL_VENDOR) returns "ATI..."
>  *  glGetString(GL_RENDERER) returns "RADEON..."
>  *  glGetString(GL_VERSION) returns "1.2.2204 Win9x Release"
>  *  glGetString(GL_EXTENSIONS) returns a lot of GL_ARB and GL_EXT
> extensions
> so  I guess I could get the HW rendering.

> I hope my english is not too bad. ^_^;

> Bye, Shad Derow.

 
 
 

OpenGL and Hardware acceleration?

Post by Shad Dero » Mon, 30 Jun 2003 04:44:04


Hello, Roger!
You wrote  on Sat, 28 Jun 2003 19:42:50 +0100:

[...]
 RR> It could be that, although you request it, the pixel format you get
 RR> from ChoosePixelFormat ignores the s/w version in favour of t5he
 RR> other flags you asked for.

I didn't think it, but...

 RR> Instead of your existing code, try -

 RR> int bmp_format = pfd_new.dwFlags & PFD_DRAW_TO_BITMAP;
 RR> int generic_accelerated = pfd_new.dwFlags &
 RR> PFD_GENERIC_ACCELERATED;

 RR> if(bmp_format && !generic_accelerated)
 RR>   MessageBox(NULL, "Software only", "OpenGL Information",
 RR>  MB_ICONINFORMATION|MB_OK);

...yes, you're right.
I've tried also to add this to your suggestion

/***********Code : Begin **************/
 else if (!bmp_format)
  MessageBox(NULL, "No bmp", "OpenGL Information",
  MB_ICONINFORMATION|MB_OK);
/**********Code : End ****************/

And the only MessageBox showed is "No bmp"
Thanks, now I know something new :-)

 RR> PS - Your english is fine :-))

Thanks #^_^# (blushing)

Bye, Shad Derow.

 
 
 

1. Visual C++ and OpenGL loosing hardware acceleration

I have an annoying problem with OpenGL. I use Visual C++ 6.0
to develop an OpenGL application but several times a day
OpenGL seems to loose hardware acceleration and return
to software. The only way around this that I have found is to
reboot the system.

Has anyone experienced the same problem (and found a
solution)?

I use Win98 and a TNT2 Ultra.

Thanks!

==============================
Mattias Widmark, Software Designer
www.st.se/blueberry
+46-8-587 623 09, 0708-14 52 49
Sj?land & Thyselius Datakonsulter AB
Sehlstedsgatan 6, 115 28 Stockholm
==============================

2. Does alpha get rendered to off-screen render target?

3. Does OpenGL use hardware acceleration in Win95/98?

4. PSP 8

5. OpenGL and hardware acceleration

6. Colorgradient trouble in 16-bit color display mode

7. OpenGL and hardware acceleration on Win95

8. help ! Kai's Power tools WIN95 AMDK6 AdboePS 4.0.1

9. OpenGL and Hardware Acceleration on NT system

10. OpenGL and Hardware Acceleration

11. Linux Mesa/OpenGL with hardware acceleration for Permedia 2 ?

12. OpenGL Hardware Acceleration (Mac)

13. OpenGL Hardware Acceleration