Advertisement

OpenGL & multithreading

Started by January 06, 2002 12:39 PM
11 comments, last by LowRider 23 years, 1 month ago
Hi, I''m a Win32 programmer starting out on OpenGL. I have a Dual PIII 1050MHz with 768MB RAM and a NVidia Quadro 2MXR. I would like to know something more about programming in OpenGL using MultiThreading. I know how to work with multithreads, and I know a little about OpenGL. Question: Can I calculate the OpenGL image using Dual CPU? I thought I could work with interlacing. Let one CPU do the even lines and the other the odd lines. And then composing both into a final image. Is this possible? Are there other ways to implement SMP into OpenGL?? I made a first program, a standard OpenGL teapot, and copied the Maya view rotation controls (Alt. + left mouse button) to ''examine'' the Teapot in 3D view. I also included a fps string, problem is that my CPU''s are at 50% (would be 100% on a single CPU) and I get only 45.28fps. Is my Quadro 2 not used to render the OpenGL?? What do I have to do to get Hardware acceleration?? Thanks... LowRider... LowRider
LowRider
Do you have up-to-date drivers?

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
Advertisement
As up to date as I can get.
Tried drivers from the manufacturer (ELSA) and drivers from nVidia (Detonator drivers)

It''s only with programs that I write.
Other OpenGL programs work well with hardware acceleration...



LowRider
LowRider
That''s really weird. Hmmm... This may seem odd, but I recall there is a setting by which you enable hardware acceleration in the window creation code. Don''t remember what is is though. It''s a tag somewhere.

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"
Alex BroadwinA-Tronic Software & Design-----"if you fail in life, you were destined to fail. If you suceed in life, call me.""The answer is out there.""Please help, I'm using Windows!"
I''ll take a peep at it...
But that would only cover half of my problem...



LowRider
LowRider
Are you definately setting an accelerated PixelFormat?

And what are you doing on each processor?
Advertisement
I''m not setting ANY pixelformat.
I''m using the GLUT library to create my windows.

I want my app to be crossplatform.

You mean that I can''t get accelerated OpenGL without the Windows code??? (rendering and device context etc.)

What do you mean, what am I doing on each processor?



LowRider
LowRider
I meant what threads are you running? What ascpects of the program are running in which thread?

And glut would normally give you accelerated OpenGL.
Well, that was part of my question.

What parts of the program CAN I use for Multithread?
Right now it runs on 1 CPU.
But I would like to implement the MT, but don''t know where to start.



LowRider
LowRider
Sorry - I misread the question!

As a general rule, most people dedicate one thread to graphics rendering, and another to IO (including networking) and AI. Also, if you use many textures, a seperate loading thread can be beneficial.

However - there was an interesting topic on OpenGL.org advanced forum about threading on single CPU systems. If you know your app will always run on multiple CPU''s this won''t be too relevant (apart from the normal synchronisation problems). But expect a slight decrease in performance on single CPU''s.

This topic is closed to new replies.

Advertisement