Jump to content
  • Advertisement
Sign in to follow this  
Extrarius

OpenGL Introduction to Modern Graphics Programming and Theory?

This topic is 4147 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've been programming for a very long time, and back when I got into game programming WinG was all the rage and books still covered using assembly modules interspersed with C to write nice 16-color games in DOS. Unfortunately for myself, as the world moved on and embraced DirectX and OpenGL and Shaders etc, I didn't move on so much - most of the programming I've done since then was limited to console utilities, form-based applications, and GDI-drawn graphics. In other words, I haven't kept up with the times in the world of graphics. I have, however, tried - I have books covering DirectX (such as "DirectX Complete", "3D Game Prgoramming with C++", and "Zen of Direct33D Game Programming", both outdated now and not so great even new) and I've read plenty of web tutorials on OpenGL (Such as those available from NeHe). One thing I've found in all such books (besides being generally terrible) and resources is that they don't really cover the "Right Way" to do things - for example, no real game should be calling glBegin/glEnd all over the place and should instead use things like vertex buffers. Not only that, but they often have very poor descriptions of each step involved in doing anything so the best you can come away with is a copy/paste manual (and their code is such that it really shouldn't be copied). Not only do I need to learn APIs, but I also need to learn algorithms - I hear a lot about Octrees for example, and I know what they are, but they really seem like pretty much the worst solution possible for spatial partitioning since they can have huge problems when things cross certain boundaries. What are the alternatives, what benefits and drawbacks does each have, etc? Besides spatial partitioning algorithms, there are all kinds of other algorithms I need to be familiar with if I want to write a modern graphical program - shaders make all manner of things possible but also require quite a bit of knowledge I simply don't have at the moment. I'd really love to catch up with everything so I can start working on some of my projects, but I really have no idea where to start since I've had such bad luck finding good resources. Are there any good resources that touch on these many topics to a useful degree?

Share this post


Link to post
Share on other sites
Advertisement
Some books:
Fundamentals of Computer Graphics, 2nd Ed.
Computer Graphics, Principals and Practice
The Geometry Toolbox
Essential Math for Games and Interactive Applications
Visualizing Quaternions
Curves and Surfaces in Geometric Modelling
Computer Animation: Algorithms and Techniques
Real-Time Rendering
Real-Time Collision Detection
Collision Detection in Interactive 3D Environments
3D Game Engine Architecture
Game Physics

I tend to recommend these for various purposes, but your asking for a pretty broad view of things so you should check them out and see if they seem like they'll work for you. I used to have a page on my website that broke them down based on why they were good and what they covered, but I've taken it down and have not yet fixed it, sadly.

As you noted, I generally find any book that touches on a specific API to be a complete waste of my money; usually they contain little more than stuff that already in the API docs or available elsewhere.

The ShaderX and GPU Gems books are good, but mainly after you have a good feel for modern graphics stuff. Also, the SDK documentation or the Red Book / Blue Book / Orange Book (for D3D and OpenGL respectively) can be useful. There's also some good stuff in the Game Gems books, but you have to evaluate if the rest of the content justifies the price, for you.

Also, get an ACM membership or access to the SIGGRAPH archives in some way, there are lots of papers (new and old) that are really useful to read.

Share this post


Link to post
Share on other sites
Quote:
Original post by Extrarius
One thing I've found in all such books (besides being generally terrible) and resources is that they don't really cover the "Right Way" to do things - for example, no real game should be calling glBegin/glEnd all over the place and should instead use things like vertex buffers. Not only that, but they often have very poor descriptions of each step involved in doing anything so the best you can come away with is a copy/paste manual (and their code is such that it really shouldn't be copied).
There is no 'right way'. Intermediate begin/ends are fine until you want to fine tune for speed later on. And even after that, there are a few different ways to go about it. Simple one is to create a list of things to be rendered, then sort by GL state, and render them all, by calling their vertex buffers instead of Begin/End pairs.

Reading the blue and red books should be enough to get you going.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vampyre_Dark
[...]There is no 'right way'. Intermediate begin/ends are fine until you want to fine tune for speed later on. And even after that, there are a few different ways to go about it. Simple one is to create a list of things to be rendered, then sort by GL state, and render them all, by calling their vertex buffers instead of Begin/End pairs.

Reading the blue and red books should be enough to get you going.
There are definitely 'more right' ways - using only intermediate mode would be silly and would not only be a potential speed problem but it would also probably cause significant 'code smell' instead of encouraging proper modularization and other such good things. I would appreciate the the ISBN numbers of the various colored books.


jpetrie: Thanks for the list. I already own Game Programming Gems 1 and 2 and found a lot of interesting information, but not exactly the kind of information I'm looking for here. The SDK documentation is a great reference, but not so great a learning tool. I can certainly use it to make a program, but I'm not sure it provides enough information for me to make informed decisions about different approaches etc since each API offers many ways to do things.

Share this post


Link to post
Share on other sites
Quote:
Original post by Extrarius
There are definitely 'more right' ways - using only intermediate mode would be silly and would not only be a potential speed problem but it would also probably cause significant 'code smell' instead of encouraging proper modularization and other such good things.
Begin/end is not 'wrong', it's just not the fastest way.

In the end, it's all a call to something like CMesh::Render() anyways. The code differences between making a vertex array, a display list, and just having a begin/end aren't much different.

I don't see where 'code smell' comes into play. It's all the same thing in your code give or take a few lines.

Quote:
I would appreciate the the ISBN numbers of the various colored books.
They are linked free on GL's website, their numbers should be there.

Share this post


Link to post
Share on other sites
It seems you're interested in best practices more than the hardcore (mathematical) theory behind things, right?

Find yourself a good forum, such as this one [cool], and keep on top of new discussion. Even if you don't follow all the finer details you'll spot the occasional gem from some experienced member - just a one liner comment or short paragraph in the middle of something much bigger...

I lurk on DirectXDev for this reason - a very good signal:noise ratio with some extremely talented people frequenting it. You pick up a lot of experience and best practice by just keeping up with whatever they're on about!

Failing that, conference material is always a great place to pick up best practices. Lots of ATI/Nvidia slide decks will (with appropriate bias [wink]) pass on lots of information about how to make the most of a technology and give good examples of what to do and what not to do...



hth
Jack

Share this post


Link to post
Share on other sites
I can't recommend Dave Eberly's books enough. Check it out at www.GeometricTools.com, and you can download his engine source code for free. He covers the algorithms and math that are needed for modern engine design - which I think is what you are looking for!

Share this post


Link to post
Share on other sites
More than algorithms or APIs, it seems that what you really need to learn about is the way the hardware works. Concepts like "I should use vertex buffers/objects instead of DPUP/glVertex where possible" follow naturally from understanding the data flows involved in each case.

For this, I'd second jpetrie's first two books along with Real-Time Rendering by Moller and Haines; I'd also recommend reading this chapter from GPU Gems 2 that describes the architecture of a recent graphics device (the GeForce 6 series).

Share this post


Link to post
Share on other sites
Quote:
Original post by jollyjeffers
It seems you're interested in best practices more than the hardcore (mathematical) theory behind things, right?[...]
Well, I need both really, but yes, I think resources on best practices is the thing I need most - the fundamental math behind it all is IME covered much better by books and random websites than any other relevant topic. Best practices and practical algorithm details are the things I need help finding information on.

Re All: Thanks for the many suggestions. This is probably the most helpful 'general advice' thread I've ever had. More is always appreciated, of course =-)

Learning as a hobby is frustrating - so many books and so little time =-( I'd love to complete my collection of Game Programming Gems and AI Game Programming Wisdom, start on GPU Gems and ShaderX, etc. Ah well, I've got a lifetime to go. If only they'd take a break on writing new books and give me time to catch up.

[Edited by - Extrarius on May 12, 2007 4:35:05 PM]

Share this post


Link to post
Share on other sites
jollyjeffers: You mention DirectXDev, but the only links I can find to such a thing are to a subdomain of microsoft that always results in a "server not found" message. What is the correct current address?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!