|
|
Comments and Discussions
|
|
 |

|
lazygenius wrote:
Any insights of using OpenMP and OpenGL would be greatly appreciated.
I haven't used it, although it would be a bit interesting to look into. So far, I've been allowing the OS's SMP scheduler handle the grunt work, of course I do set affinity. But, if I can push better performance out of OpenMP that would be nice, although I don't really have a supercomputer to test things out on.
|
|
|
|

|
For more complex models I wonder about introducing a third thread (or utilising the main thread more) for manipulating the model. As I understand it there is a latency issue with SwapBuffers whereby the SwapBuffers call, or the next GL call will block the thread.
Even in your secondary thread you are going to experience that latency, no? If SwapBuffers does block it would be nice to kick off another thread for doing CPU based work such as collision detection or general housekeeping. If SwapBuffers doesn't block then I guess this work could be done directly after SwapBuffers being sure not to call any GL functions.
Still beats the hell out of GDI either way!
|
|
|
|

|
lazygenius wrote: For more complex models I wonder about introducing a third thread (or utilising the main thread more) for manipulating the model.
Definitely, I don't want to suggest you only need two threads in all scenarios. Typically though, most apps tend to have only one render thread however.
This skeleton isn't a end-all-be-all by any means. I wanted I wanted to achieve with this is give people something to use as a skeleton when making their multithreaded OGL apps on Windows. It's just a start that contains most of what you'll use over and over again.
lazygenius wrote: Even in your secondary thread you are going to experience that latency, no?
Yup, but the latency can't be avoided with just about any 3D pipeline. As far as blocking, I haven't ran across that myself. If you have a link or more info on it; I'd be grateful.
The idea behind the threading is more about concurrency in that while you do swap buffers going on you could also be doing something like processing the AI for the next frame on another core. The slow down is mitigated and not really gotten rid of, but the end result could be faster overall.
lazygenius wrote: Still beats the hell out of GDI either way!
Amen to that.
|
|
|
|

|
Did you check out ApocalyX3D (scipted in LUA) ?
Another good option is the Breve engine (has it own script language and Python).
Both are excellent pieces of open source
|
|
|
|

|
Very well done article. Found it well written and informative. I am going to add it to my blog
Paul
I'd like to help but I don't feel like Googling it for you.
|
|
|
|

|
Thank you. I'm just debating on whether or not to leave it as is or update to reference the engine when it's done.
So far, I'm thinking of leaving it be and using to show small, concentrated aspects of OGL. And then maybe have a engine base example for the larger, more complex examples. Meh, who knows.
|
|
|
|

|
Jeremy Falcon wrote: maybe have a engine base example for the larger, more complex examples
That would be really cool
If you try to write that in English, I might be able to understand more than a fraction of it. - Guffa
|
|
|
|

|
PaulC1972 wrote: That would be really cool
Well the idea is to release it on CP. So I may as well write articles on it so I can get platinum status.
|
|
|
|

|
Jeremy Falcon wrote: So I may as well write articles on it so I can get platinum status
Yeah, go for it. I only have like 25 articles to write :->
Some people have a memory and an attention span, you should try them out one day. - Jeremy Falcon
|
|
|
|

|
How far is your engine now? Do you have something ready? I would be very interested...
Regards
Daniel
|
|
|
|

|
Thanks for the interest. It recently passed the initial design phase. I already have Windowing abstractions set in place for cross platform, but no inter-game GUI elements yet like listboxes, etc.
I was in the middle of implementing the thread pool when I got pulled aside to do some work (not by choice ). But, once that's done and I get a rough renderer set in place I may go ahead and write a pre-alpha article on it just to get some feedback/ideas about it.
I still have a long way to go. It'll be in alpha for a while. I want to get something functional first (3D audio, scene graph, timing, etc.) going before adding more advanced stuff like shaders. It's all a work in progress and could easily be a year before it's done. But, I'll most likely post something on CP before that time.
GUI
|
|
|
|

|
hi,
i am looking for a minimal opengl framework that supports picking elements in the model and interactive navigation such as pan, zoom, rotate, orbit ... does anybody know of a good clean implementation of such a beast? preferable platform independent, e.g. wxWindows based?
cheers
jeremy
|
|
|
|

|
jekata wrote: i am looking for a minimal opengl framework that supports picking elements
How minimal is minimal? If all you're looking for is picking, then just integrate the code from a tutorial online rather than using a full-blown framework.
One such example: Clickety[^]
jekata wrote: interactive navigation such as pan, zoom, rotate, orbit
There are a lot of camera classes for OpenGL in C++. Here's one such example for you're coding pleasure: Clickety[^]
|
|
|
|

|
I agree with everyone else and your article is well written and will definitely aid coders in writing OpenGL apps. Earlier in my Windows programming career, I did some testing to determine the speed difference between Windows messaging and using Events and memory mapped files to pass messages. Like you, my first code was written in C, not C++. I cannot find my data after 8 years, but I seem to remember that the Windows based mesaging came out slower. I alo did some playing around with priorities at the time and that certainly could have been a factor in the differences. Have you ever done any tests in looking at the differences in response times of the 2 methods?
Kenneth Krueger Jr.
|
|
|
|

|
Kenneth Krueger wrote: Have you ever done any tests in looking at the differences in response times of the 2 methods?
No I haven't. My threading experience has been in Windows only, so I naturally got used to using the messaging route. You have, however, piqued my interest and I'd love to hear more about using memory mapped files for messaging. I'm not sure if it's faster or not, but I have no problem testing it out to see.
As far as threading priority, that very may well be something I add to the example at a later date. I kinda got side-tracked working on my engine and it's taking a lot of time.
|
|
|
|

|
Windows uses the message loop as one of the triggers for context switching applications. Another trigger is the Sleep() function. So perhaps by avoiding the message loop and using memory mapped files you could give your application a higher priority when it really needed it. Or did you get more consistent framerates by avoiding the message loop?
Todd Smith
|
|
|
|

|
Todd Smith wrote: So perhaps by avoiding the message loop and using memory mapped files you could give your application a higher priority when it really needed it.
Well, I've never used memory mapped files for threading, so it's still a subject I'd like to dig into some more. Perhaps over the holiday weekend and compare to the two.
Todd Smith wrote: Or did you get more consistent framerates by avoiding the message loop?
I never did avoid using a message loop. The reason being I wanted to allow Windows to handle the threading priorities naturally so I don't hog down the system. With that being said, I don't notice a major performance penalty over using messaging say compared to global variables (yeah, there is one of course). But, the idea behind messaging is A: it's a lot more flexible and B: it helps with encapsulating details.
However, if using a memory mapped file can help me achieve the same thing but faster then I'm all ears.
|
|
|
|

|
Good article and refresher on multithreading. My only complaint is that it might have abit heavier error checking, especially in InitScene, where initialization can and will go wrong.
A cynic is a man who, when he smells flowers, looks around for a coffin. -H.L. Mencken
|
|
|
|

|
JWood wrote: Good article and refresher on multithreading.
Thanks.
JWood wrote: My only complaint is that it might have abit heavier error checking, especially in InitScene, where initialization can and will go wrong.
You're right. I may make an update to it that adds this, as the whole purpose of the skeleton app is to be ready for the real world.
|
|
|
|

|
hu... what about a D[^] version?
I know, I could write it myself, but I have a lazy and sick curiosity about it...
|
|
|
|

|
Super Lloyd wrote: what about a D[^] version?
Um... Yeah, I'll have it ready around the year 2045.
Seriously though, I don't know D, and I'm trying to stay away from learning a new language right now while I'm racking my brain with all sorts of learning materials (I'm making a game engine), and if I push it any further I'm afraid my head will explode.
|
|
|
|

|
Already busy doing something else!! Good luck then!
(I know that feeling, same for me in fact)
A game engine, cool! Is it based around the quake engine?
|
|
|
|

|
Super Lloyd wrote: A game engine, cool! Is it based around the quake engine?
It's a home brew engine, using libs (like libpng) internally where I can cut a few corners.
I'm mainly doing it for the learning experience. It already supports texture mapped fonts w/ kerning, PNG HDR TGA and JPG image formats, and filters like sharpen, etc. Of course, I still have a looooooong way to go, but one step at a time.
|
|
|
|
|

|
Super Lloyd wrote: but does it support international rich text?!
Well, the engine uses a pre-rasterized, luminance (w/ alpha) image for speed during loading.
At first I tried using freetype, but the load time was too slow for my liking, and then came its issue with being dog-slow with kerning, so I dumped it.
Anywho, rich text is supported in the fact that if you want a bold and/or italic font, the font creator program included with my engine will convert that. So, you can create two different fonts (say a normal version and an italic version) and mix and match them however you want when displaying the text.
Is does support different colors by passing a command and color value in the input string for the drawing routine, so you could draw any char in any color you wanted.
It theoretically supports Unicode in the image file format as it stores the char codes mapped at 16-bit ints, but the little helper tool I made to create the font file loads the ANSI charset to pull the glyph data from (forward thinking at least for now).
Super Lloyd wrote: Just for fun and to show that I do some homework too
It looks cool. How much do you plan on doing with it?
Super Lloyd wrote: http://www.nova-mind.com/[^]
Ok, that looks real interesting. How much does that sell out of curiosity? You making a killing yet?
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
Provides a base to use when programming OpenGL-enabled applications for the real world, rather than a simple hello world.
| Type | Article |
| Licence | CPOL |
| First Posted | 26 Aug 2006 |
| Views | 131,845 |
| Downloads | 3,593 |
| Bookmarked | 95 times |
|
|