OpenGL ES 2.0 Programming Guide
Martin Ecker writes "Mobile phones and other embedded devices are getting more and more powerful each year. The availability of dedicated hardware for 3D rendering is becoming increasingly ubiquitous, and the latest mobile phones come with 3D hardware acceleration that rivals the power of desktop graphics hardware. OpenGL ES 2.0 is the latest version of a cross-platform, low-level graphics API to utilize these new resources available in embedded devices. The OpenGL ES 2.0 Programming Guide published by Addison-Wesley Publishing aims to help the reader make use of the full power of OpenGL ES 2.0 to create interesting 3D applications." Keep reading for the rest of Martin's review.
OpenGL ES 2.0 Programming Guide
author
Aaftab Munshi, Dan Ginsburg, Dave Shreiner
pages
417
publisher
Addison-Wesley Publishing
rating
7/10
reviewer
Martin Ecker
ISBN
0-321-50279-5
summary
All you need to know to develop mobile phone 3D applications in OpenGL ES 2.0
The book is intended for an audience with experience in the C programming language and a solid foundation in computer graphics. No experience with the desktop version of OpenGL is necessary, however. The book starts out with a basic introduction of OpenGL ES and explains the differences between OpenGL ES 1.x and 2.0. The main difference is that 2.0 has completely dropped support for the fixed-function pipeline and is now completely shader-based. The book then immediately gets the reader's feet wet by discussing a first simple example program that renders a triangle on the screen. This is also where the downsides of dropping fixed-function support in OpenGL ES 2.0 become apparent. It takes almost 4 pages of code to render a simple triangle. The reason for this is that you need to write a vertex and fragment shader (albeit really simple ones) to transform vertices to device coordinates and to assign a color to each pixel of the triangle. Of course, in "real-life" applications this isn't much of a problem. The increased possibilities that programmable shaders have to offer outweigh the inconvenience of having a bit more setup code.
The book continues to discuss EGL, which is like WGL on Windows or GLX on Unix, i.e. the interface between OpenGL and the underlying operating system. The next few chapters give a basic introduction to the OpenGL Shading Language. As mentioned above, with OpenGL ES 2.0 using shaders is the only way to get something on the screen. So having a good grasp of the OpenGL Shading Language is essential. The discussion at this point is fairly dry and might overwhelm readers that haven't used a shading language before. Later chapters, however, delve more deeply into developing vertex and fragment shaders.
The subsequent chapters present how to specify vertices and primitives in OpenGL ES. OpenGL ES 2.0 only supports generic vertex attributes (since there is no fixed-function pipeline anymore) and vertex data can only be specified using vertex arrays or vertex buffer objects. Immediate mode as known from desktop OpenGL is not available.
Now that the reader is familiar with sending vertices and triangles to the 3D hardware, the book describes vertex and fragment shaders in more detail. There is also a pretty long chapter on texture mapping, going into the specifics of the API calls to define and upload textures to the hardware. There are numerous examples in these chapters that demonstrate how to do lighting, generate texture coordinates, perform vertex skinning, multitexturing. These are all essential examples because the fixed-function pipeline that used to do these things is not available in OpenGL ES 2.0.
The next two chapters deal with the backend of the pipeline discussing the various per-fragment operations following the fragment shader, such as stencil test, scissor test, depth test, and framebuffer blending. Also framebuffer and renderbuffer objects (FBOs) used to efficiently implement render-to-texture in OpenGL are discussed. FBOs are thankfully fully supported in OpenGL ES 2.0. It's nice to see a whole chapter on this topic since this particular feature took a long time to make its way into OpenGL.
Chapter 13 on advanced programming with OpenGL ES is probably the best part of the book for me. It is one of the longest chapters of the book and contains numerous examples of advanced shader techniques, such as per-pixel lighting, point sprite particle systems, 3D noise, procedural textures, and some others. The provided examples are a good starting point for experimentation.
The book concludes with a chapter on state queries, which are used to obtain various parameters about the OpenGL render state, and a chapter on the interesting topic of using OpenGL ES on handheld platforms, which briefly goes into OpenKODE. OpenKODE is a standard set of APIs that provides a unified interface to the system OS of handheld devices.
Overall, the OpenGL ES 2.0 Programming Guide is an excellent book if you want to start developing 3D graphics applications for today's embedded devices and bleeding-edge mobile phones. The book also does a good job of pointing out the differences and similarities with desktop OpenGL. So if you're already familiar with OpenGL the book can help you identify the limitations of OpenGL ES compared to its big cousin.
Martin has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios in sunny California.
You can purchase OpenGL ES 2.0 Programming Guide from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
The book continues to discuss EGL, which is like WGL on Windows or GLX on Unix, i.e. the interface between OpenGL and the underlying operating system. The next few chapters give a basic introduction to the OpenGL Shading Language. As mentioned above, with OpenGL ES 2.0 using shaders is the only way to get something on the screen. So having a good grasp of the OpenGL Shading Language is essential. The discussion at this point is fairly dry and might overwhelm readers that haven't used a shading language before. Later chapters, however, delve more deeply into developing vertex and fragment shaders.
The subsequent chapters present how to specify vertices and primitives in OpenGL ES. OpenGL ES 2.0 only supports generic vertex attributes (since there is no fixed-function pipeline anymore) and vertex data can only be specified using vertex arrays or vertex buffer objects. Immediate mode as known from desktop OpenGL is not available.
Now that the reader is familiar with sending vertices and triangles to the 3D hardware, the book describes vertex and fragment shaders in more detail. There is also a pretty long chapter on texture mapping, going into the specifics of the API calls to define and upload textures to the hardware. There are numerous examples in these chapters that demonstrate how to do lighting, generate texture coordinates, perform vertex skinning, multitexturing. These are all essential examples because the fixed-function pipeline that used to do these things is not available in OpenGL ES 2.0.
The next two chapters deal with the backend of the pipeline discussing the various per-fragment operations following the fragment shader, such as stencil test, scissor test, depth test, and framebuffer blending. Also framebuffer and renderbuffer objects (FBOs) used to efficiently implement render-to-texture in OpenGL are discussed. FBOs are thankfully fully supported in OpenGL ES 2.0. It's nice to see a whole chapter on this topic since this particular feature took a long time to make its way into OpenGL.
Chapter 13 on advanced programming with OpenGL ES is probably the best part of the book for me. It is one of the longest chapters of the book and contains numerous examples of advanced shader techniques, such as per-pixel lighting, point sprite particle systems, 3D noise, procedural textures, and some others. The provided examples are a good starting point for experimentation.
The book concludes with a chapter on state queries, which are used to obtain various parameters about the OpenGL render state, and a chapter on the interesting topic of using OpenGL ES on handheld platforms, which briefly goes into OpenKODE. OpenKODE is a standard set of APIs that provides a unified interface to the system OS of handheld devices.
Overall, the OpenGL ES 2.0 Programming Guide is an excellent book if you want to start developing 3D graphics applications for today's embedded devices and bleeding-edge mobile phones. The book also does a good job of pointing out the differences and similarities with desktop OpenGL. So if you're already familiar with OpenGL the book can help you identify the limitations of OpenGL ES compared to its big cousin.
Martin has been involved in real-time graphics programming for more than 10 years and works as a professional game developer for High Moon Studios in sunny California.
You can purchase OpenGL ES 2.0 Programming Guide from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I don't know. I don't care.
It's monday and I have to work.
Sigh.
& when it's done, we'll be repaying/repairing the damages for decades to come. the perpetrators should be put on public display, to help us remember what can happen when greed, fear & ego based LIEforms go unchecked.
greed, fear & ego are unprecedented evile's primary weapons. those, along with deception & coercion, helps most of us remain (unwittingly?) dependent on its' life0cidal hired goons' agenda. most of yOUR dwindling resources are being squandered on the 'wars', & continuation of the billionerrors stock markup FraUD/pyramid schemes. nobody ever mentions the real long term costs of those debacles in both life & any notion of prosperity for us, or our children, not to mention the abuse of the consciences of those of us who still have one. see you on the other side of it. the lights are coming up all over now. conspiracy theorists are being vindicated. some might choose a tin umbrella to go with their hats. the fairytail is winding down now. let your conscience be yOUR guide. you can be more helpful than you might have imagined. there are still some choices. if they do not suit you, consider the likely results of continuing to follow the corepirate nazi hypenosys story LIEn, whereas anything of relevance is replaced almost instantly with pr ?firm? scriptdead mindphuking propaganda or 'celebrity' trivia 'foam'. meanwhile; don't forget to get a little more oxygen on yOUR brain, & look up in the sky from time to time, starting early in the day. there's lots going on up there.
http://news.google.com/?ncl=1216734813&hl=en&topic=n
http://www.nytimes.com/2007/12/31/opinion/31mon1.html?em&ex=1199336400&en=c4b5414371631707&ei=5087%0A
http://news.yahoo.com/s/ap/20080918/ap_on_re_us/tent_cities;_ylt=A0wNcyS6yNJIZBoBSxKs0NUE
http://www.nytimes.com/2008/05/29/world/29amnesty.html?hp
http://www.cnn.com/2008/US/06/02/nasa.global.warming.ap/index.html
http://www.cnn.com/2008/US/weather/06/05/severe.weather.ap/index.html
http://www.cnn.com/2008/US/weather/06/02/honore.preparedness/index.html
http://www.cnn.com/2008/TECH/science/09/28/what.matters.meltdown/index.html#cnnSTCText
http://www.nytimes.com/2008/06/01/opinion/01dowd.html?em&ex=1212638400&en=744b7cebc86723e5&ei=5087%0A
http://www.cnn.com/2008/POLITICS/06/05/senate.iraq/index.html
http://www.nytimes.com/2008/06/17/washington/17contractor.html?hp
http://www.nytimes.com/2008/07/03/world/middleeast/03kurdistan.html?_r=1&hp&oref=slogin
http://biz.yahoo.com/ap/080708/cheney_climate.html
http://news.yahoo.com/s/politico/20080805/pl_politico/12308;_ylt=A0wNcxTPdJhILAYAVQms0NUE
http://www.cnn.com/2008/POLITICS/09/18/voting.problems/index.html
http://news.yahoo.com/s/nm/20080903/ts_nm/environment_arctic_dc;_ylt=A0wNcwhhcb5It3EBoy2s0NUE
(talk about cowardlly race fixing/bad theater/fiction?) http://money.cnn.com/2008/09/19/news/economy/sec_short_selling/index.htm?cnn=yes
http://www.nytimes.com/2008/10/04/opinion/04sat1.html?_r=1&oref=slogin
(the teaching of hate as a way of 'life' synonymous with failed dictatorships) http://news.yahoo.com/s/ap/20081004/ap_on_re_us/newspapers_islam_dvd;_ylt=A0wNcwWdfudITHkACAus0NUE
is it time to get real yet? A LOT of energy is being squandered in attempts to keep US in the dark. in the end (give or take a few 1000 years), the creators will prevail (world without end, etc...), as it has always been. the process of gaining yOUR release from the current hostage situation may not be what you might think it is. butt of course, most of US don't know, or care what a precarious/fatal situation we're in. for example; the insidious attempts by the felonious corepirate nazi execrable to block the suns' light, interfering with a requirement (sunlight) for us to stay healthy/alive. it's likely not good for yOUR health/memories 'else they'd be bragging about it? we're intending for the whoreabully deceptive (they'll do ANYTHING for a bit more monIE/power) felons to give up/fail even further, in attempting to control the
but not as good as shaved beaver.
Great! I was waiting for this book to be out. So I can write OpenGL apps for the iPhone.
Any idea when the iPhone SDK will reflect this update?
slashdot rocks
No?
Very disappointed. I want to be able to put on a pair of 3d glasses and look around and see all of the information superimposed on reality.
I'm not going to shell out any cash till that's one of the features.
Deleted
the latest mobile phones come with 3D hardware acceleration that rivals the power of desktop graphics hardware
If, by "desktop graphics hardware" we're comparing to the books, empty bottles and other assorted clutter, it exceeds them.
If, however, we mean "desktop PC"... it only rivals it if we're talking about integrated chipsets from a decade ago.
It's a cute dream. And Monkey Ball on my 480x320, ~50% of VGA resolution iPhone doesn't look half bad for a simplified version of a GameCube era title. But, even accepting there's better hardware than the iPhone for 3D... It's a LONG way from rivalling desktop graphics quality, even on a pixel for pixel comparrison where a 0.15MP phone is trying to compete with a 2.3MP 24 inch monitor that's pushing around 15x the number of pixels.
It's kind of like saying I rival an olympic runner. It's true in so far as we both have legs and, if I limit my competing to being against small children in my own backyard, I can often win. In every other way that counts, it's just not happening though.
This is what it would be like, if the majority of people were athiests.
ATHIEST KID: Mom, I'm going to go fuck a hooker.
ATHIEST MOM: Okay, son.
ATHIEST KID: Afterwards, I'm going to go smoke pot with my friends, since it's "not addictive."
ATHIEST MOM: Okay, come home soon!
The athiest kid leaves the room. The father comes home from work several minutes later.
ATHIEST DAD: Hey!
ATHIEST MOM: Hi, honey! I'm pregnant again. I guess I'll just get another abortion, since "fetuses don't count as human life."
ATHIEST DAD: Okay, get as many abortions as you want!
ATHIEST MOM: Oh, and don't go in the bedroom.
ATHIEST DAD: Why not?
ATHIEST MOM: There are two gay men fucking eachother in there.
ATHIEST DAD: Why are they here?
ATHIEST MOM: I wanted to watch them do it for awhile. They just aren't finished yet.
ATHIEST DAD: Okay, that's fine with me!
Suddenly, their neighbor runs into the house.
ATHIEST NEIGHBOR: Come quick, there's a Christian outside!
ATHIEST MOM: We'll be right there!
The athiest couple quickly put on a pair of black robes and hoods. They then exit the house, and run into the street, where a Christian is nailed to a large, wooden X. He is being burned alive. A crowd of athiests stand around him, all wearing black robes and hoods.
RANDOM ATHIEST: Damn you, Christian! We hate you! We claim to be tolerant of all religions. But we really hate your's! That's because we athiests are hypocritical like that! Die, Christian!
THE END
Scary, isn't it?
...particularly including desktops, is this really the way to go? If something is written to the OpenGL ES 2.0 API, besides 'mobile devices' what desktop systems (Linux, Mac, Windows) could it run on?
PHEM - party like it's 1997-2003!
OpenGL ES is a subset of OpenGL. For 2.0, they removed much of the fixed function pipeline and replaced it with GLSL (OpenGL's shading language). As such, I would expect it to be relatively straightforward to write ES code that runs on a modern OpenGL desktop (one that supports the latest GLSL). At most you'll need a few #ifdefs.
I'm guessing that there are a few gotchas, possibly nasty ones; but OpenGL ES is almost entirely a subset of OpenGL proper, and so should play fairly well with anything that has an OpenGL implementation.
a GAY N>IGGER
I have this book sitting in my Amazon cart, because I might get it for developing 3D stuff on the Pandora.
I preordered the Pandora, and should get it by Christmas, so I haven't gotten this book yet.
If I have nothing to hide, don't search me
http://vimeo.com/1716575
Demo was developed for Texas Instruments OMAP3 platform, but should run on most OpenGL ES 2.0 platforms out there. It was released at Assembly 2008 Real Wild demo competition.
Get your stinkin' 3D off my cell phone! It is yet another ridiculous piece of bloatware because of which it takes ages to turn the phone on or off. Do these developers realize that most people don't want the stuff they already implemented? How about focusing on battery life, startup time, and voice clarity instead, huh? You know, the things that actually matter in a phone, instead of making 3D games, which are cool, but most certainly do not belong on a handheld device.
It's probably worth noting that the Open Pandora PowerVR chipset is OpenGL 2.0 ES compliant. Therefore if you want a decent Linux based environment to play OGL ES with, that's the place to start. Except the first batch is sold out. Oh dear.
the latest mobile phones come with 3D hardware acceleration that rivals the power of desktop graphics hardware.
For superbly rendered phone calls, of course.
Oh, say does that Star-Spangled Banner entwine / The myrtle of Venus with Bacchus's vine?
Mediocre anime that was themed on this AR being integrated into an urban/suburban infrastructure accessible by equipped glasses. This accompanied by a romanticized "hacking"
It made me think about AR and read up on the practicalities and limitations. Obviosly the reality and practicalities of AR, or at least the combination of real-world and computer-generated data in real time, fell short. The DSP that this requires is FAR out of the range of modern hand held-devices.
Also, I can't imagine that it would be feasible to use the same DSP chip that's used for a communication devices necessary functions, to also share the load of AR processing. However, I'm way out of my field here. Expert opinion please?