Learning OpenGL ES 1.x [closed] - iphone

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
What is the quickest way to come up to speed on OpenGL ES 1.x?
Let's assume I know nothing about OpenGL (which is not entirely true, but it's been a while since I last used OpenGL). I am most interested in learning this for iPhone-related development, but I'm interested in learning how it works on other platforms as well.
I've found the book OpenGL ES 2.0 Programming Guide, but I am concerned that it might not be the best approach because it focuses on 2.0 rather than 1.x. My understanding is that 2.0 is not backwards-compatible with 1.x, so I may miss out on some important concepts.
Note: For answers about learning general OpenGL, see https://stackoverflow.com/questions/62540/learning-opengl
Some resources I've found:
http://khronos.org/opengles/1_X/
http://www.imgtec.com/powervr/insider/sdk/KhronosOpenGLES1xMBX.asp
OpenGL Distilled by Paul Martz (a good refresher on OpenGL basics)

If I may plug my own work, I'd direct you to my post at http://www.sunsetlakesoftware.com/2008/08/05/lessons-molecules-opengl-es. It's not the best overall introduction to OpenGL ES, and it gets fairly technical pretty quickly, but it's my take on the subject from my experience writing Molecules. Also, I've just started reading the book "Mobile 3D Graphics: with OpenGL ES and M3G".
I agree with the suggestion that the best way to learn is by doing. I started out knowing nothing about OpenGL and three weeks later had Molecules in for review in the App Store. Once you have a clear set of goals ("OK, I need to draw a 3-D sphere", "Now I need to rotate it on demand") it becomes easy to find the examples or parts of documentation that apply to just the task you're working on.
There are many code examples out there, although a lot of them use immediate mode and other calls that are not supported in OpenGL ES. I'd love to add to the list by releasing the source to Molecules, but Apple's NDA has prevented that so far. The source code to Molecules is now available.
Video for the class I taught on OpenGL ES 1.1 is now available to download as part of my spring course on iTunes U. The notes for that session can be found here. And the fall semester videos have a class on OpenGL ES 2.0.
Also, Philip Rideout has released an excellent book on OpenGL ES 1.1 and 2.0 development for the iPhone, called iPhone 3D Programming. I highly recommend it.

There is some documentation in iPhone SDK itself.
Other than that, just take what you know about OpenGL (or learn that via other means), and forget about all things that are "old cruft" (display lists, immediate mode, things that are in OpenGL but are not directly related to just drawing triangles). Basically, unlearn everything that has been declared deprecated in OpenGL 3.0.
GL ES 1.x is for pretty simple devices. What you have is a way to draw geometry (vertex buffers), manage textures and setup some fixed function state (lighting, texture combiners). That's pretty much all there is to it.

There are some excellent tutorials at https://web.archive.org/web/20160309222642/http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html

FYI, Brad Larsons Molecules code is now available here.

I found these quite helpful when starting out with OpenGL ES, just to see what approach one would take when dealing with ES as opposed to normal GL.
http://www.zeuscmd.com/tutorials/opengles/index.php
As has been mentioned earlier there are some samples available from the iPhone developer site as well:
https://developer.apple.com/documentation/opengles
https://developer.apple.com/library/archive/documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html

You might want to take a look at this excellent Jef LaMarche’s Tutorial to OpenGL ES on the iPhone.

After spending quite a lot of time developing 3D I came to realize that in most cases the best way is to learn by examples and advance with them as you go.
Start by setting to yourself a goal to achieve (for example - implementing a particles system. this includes usage of blending modes, textures, vertex colors, batching and transformations), and then go and start with the simplest element - drawing and rotating a quad. From there go on and add textures, add more quads, etc...
While doing that you'd need some info about the syntax - this you can find in many books, but the best (very boring) source is the specification committee publication that can be found here: http://www.khronos.org/opengles/spec/
Even with that you'd bump into many problems, well, once you have a problem go to your best friend in these situations: demos and examples!
You can find many examples sources for the iPhone online and at the apple site so download them, copy paste what you need and then alter to your needs.
Have fun.

If you have downloaded the iPhone SDK examples, check out crash landing's EAGLview file. It is a pretty straight forward implementation of a GLES view that can be imported and used fairly cleanly in another project. There is another class in that project called Texture2d (if I recall) which is also pretty interesting if you are into using GLES for 2D.

May I also suggest Android - it's easy to get and you can have a working simulator really quickly. Also, it uses v1.0 as far as I know.
There could be more tutorials, but even the APIDemos provided by Google has introduction to OpenGL ES. I certainly found it helpful.

Related

OpenGl ES on Iphone - Displaying and rotating 3D objects

I'am new to Iphone, to Xcode and to openGL ES.
I looking for an example of a source code witch demonstrates how to create 3d object, rotate it with gestures and zoom in, zoom out ...
Thanks,
Alex
Here is the simple example how to display and rotate 3d models created with Blender: http://iphonedevelopment.blogspot.com/2009/06/using-3d-models-from-blender-in-opengl.html
The complete source can be found here: http://innerloop.biz/code/ExportTest.zip
I can recommend the OpenGL SuperBible 5th Ed. It starts out with the very foundations with lots of example code (I believe the specific scenario you describe is chapter 5), and moves on to topics like platform specific development, OpenGL ES for the iPhone... - and it's a decent read, a rare quality among textbooks, in my opinion. All examples and code in the book should compile in Xcode, and they show various exceptions for individual platforms as necessary.
I am currently looking at this challenge as well.
I will put up my findings so far, and whack a bounty on this question to try and get some focus for it.
http://nineveh.gl/ promises to do the job, but it is in beta and even the most basic examples don't run out-of-the-box (they give compiler errors). so I couldn't recommend it.
It is possible to integrate Unity with native iOS code, eg
http://clevermartian.com/blog/?p=59
http://technology.blurst.com/a-cocoa-based-frontend-for-unity-iphone-applications/
but that stuff looks scary
http://www.sunsetlakesoftware.com/molecules is open source; it may be possible to lift something from there.
I see you had answered this but a good tutorial are the Lamarche Tutorials, there is also OpenGLES 2.0 tutorials:
http://iphonedevelopment.blogspot.co.uk/2009/05/opengl-es-from-ground-up-table-of.html
Also for loading up models look up setting up the POWER VR SDK as there is all the things you need to loading up a 3d model with bone animation , textures lighting e.t.c.
i am not sure if this is what you have searched and looking for but you can take a look at : http://nehe.gamedev.net/tutorial/texture_filters,lighting&_keyboard_control/15002/
in the lower portion of the page, you can see that there is the example code for macos/cocoa ..
i'm still not sure but hope this helps..
I had a play around with OpenGL ES a year or so ago, and I found this on-line O'Reilly book very helpful: http://ofps.oreilly.com/titles/9780596804824/
The chapters are typical of most books on this subject; math primer to 'Advanced' (typically your usual scene using shaders that implement cube-maps, bump-maps etc)
You are also able to download the source code for the examples.
Edit: I also own this book http://www.amazon.co.uk/OpenGL-ES-2-0-Programming-Guide/dp/0321502795/ref=sr_1_1?ie=UTF8&qid=1336064164&sr=8-1
Which I found was a good read with respect to OpenGL ES as-well as 3D graphics in general.

iOS based OpenGL ES programming

I need to find resources for learning openGL ES for the iPhone.
I've already watched Brad Larson's awesome videos and I'm downloading the advanced videos from apple now.
I know a lot about iOS programming but am clueless on OpenGL, so resources that don't assume I already know openGL.
I want to learn a majority of the OpenGL capabilities, but my major goal is to be able to manipulate an image based on the touch locations. More specifically I want to create a water ripple effect that follows the users finger.
I know there are many equations on StackFlow that implement this, but I'm lost when it comes to finding out how to use them.
I appreciate the kind words on the videos. That definitely makes the class feel like it was worth doing.
Do you have the course notes for both semesters of the class? The spring session notes can be found here in HTML format (VoodooPad format here) and the fall ones here (VoodooPad format here). The links in iTunes U aren't very obvious for those, and they contain many links to OpenGL ES resources that I thought were valuable, as well as all the sample code I show off in the classes.
I like the job that various instructors at Stanford have done with their class sessions on OpenGL ES as part of their iPhone Application Development course (also on iTunes U). They provide a different perspective on the API than I do, and both of us come at it by not assuming that you know OpenGL.
As Bart suggests, Jeff LaMarche's "OpenGL ES from the Ground Up" series is extremely popular for good reason, and he's been posting unpublished chapters from his book on OpenGL ES 2.0 lately as well.
For books, I highly recommend Philip Rideout's iPhone 3D Programming, which introduces fundamentals like the math involved, and takes you all the way through to some fairly advanced techniques. It's also one of the few books to spend a significant amount of time with OpenGL ES 2.0.
However, the best thing that I suggest for learning OpenGL ES is not to spend your time reading books and articles but actually formulate a simple project and try to implement it. Find sample applications out there that do many of the things you want to, and pick them apart. Go back to these resources when you run into brick walls and you'll better understand how the concepts all fit together. I knew very little about OpenGL when I started out with my first application using it, but I built small pieces and standalone prototypes until I knew enough to piece together something that worked.
In your case, I'd look very carefully at the resources linked in the answers to the question "GLSL for simple water surface effects", which do exactly what you want. One implementation uses OpenGL ES 1.1, the other 2.0-style shaders. Pick a way that you want to go (my personal recommendation would be to learn shaders now) and try to make a crude, functional application while working through the above videos and reading material.
You might want to have a look at this: http://iphonedevelopment.blogspot.com/2009/05/opengl-es-from-ground-up-table-of.html
These tutorials seem to be relatively beginner-friendly.
More specifically I want to create a water ripple effect that follows the users finger.
Here is code that does exactly that: http://developer.apple.com/library/ios/#samplecode/GLCameraRipple/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011222

Game platform/engine for inexperienced/solo developer? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
There are a number of discussions on stackoverflow.com about what is the best iPhone game platform/engine. My question is not necessarily what is the best, but what is the best for an experienced iPhone developer but not not experienced in game design. This will also be a solo project plus a graphics designer. Consider I will be working full-time at my day job and will need to support a number of other iPhone apps. In other words, designing the game will be very much a part-time project but needs to go out in 2 - 4 months(?). Ramp up time needs to be quick. I'd like to build 2D in the beginning and then go to 3D.
I lean toward Unity 3D since it has lots of documentation and help. From what I can see, the iPhone basic version is $399 and you get the IDE for free. Can anyone confirm?
Unity3D is for 3D but I've read you can still do 2D. I'm trying to find out what is involved there. One drawback with Unity3D is the 8-15 second Unity splash screen. I've also read this doesn't get much better with the higher priced version. But I suppose that is the price you pay for the convenience of having a simpler framework available.
Cocos2d is a great framework and free but lacks documentation. It also requires much ramp up time to learn its framework and choose a suitable physics engine. I don't see this route as practical. I can see learning it across a long timeline as a side project but then you eat into getting your game out the door fairly quick. If I go with Unity, I probably abandon Cocos2d altogether since I will have invested so much into Unity.
Does my reasoning for Unity sound feasible?
---EDIT---
Based on some of the comments, here is the type of game I'm referring to initially: A 2D shooter similar to Zomebieville but most likely without its large feature set.
I'll vote for Unity 3D. It contains a very nice interactive development environment and supports a variety of platforms (including the iPhone). If you don't have experience writing game loops or any of that, then you will depend heavily on such development environments - you might as well get the best.
If your game is worth it, people won't mind the wait screen.
This will also be a solo project plus a graphics designer.
designing the game will be very much a part-time project but needs to go out in 2 - 4 months(?).
Two words:
Forget it!
Yes - Unity3D is $399 for the basic iPhone license.
Using Unity to create 2D games works in most simplistic terms as follows:
The Camera views a 3D world and creates a 2D game when the camera is directly facing a platform from the side. I guess you could also aim the camera straight down (birds eye view) on a surface as well.
The difference is as follows: In Cocos2D you are still running an openGL ES app. You have the ability to have layers in the Z coordinates.
Unity however would be best used when using 3D objects to be animated as the art. If your art is already 2D then in Unity you would be placing your art onto a flat plane. If you are concerned about the quality of the artwork when it comes to your game - if the art is 2D then there really is no point in using Unity and spending the money.
Also consider that Unity3D's basic package will not give you access to your own methods outside of it's framework - if you have some objective c you would like in your game from say another project or you have a special server you want to connect to using your own code that will not work. This kills it for me.
I understand there is a lack of documentation however - There are a lot of tools and tutorials to help.
First consider that Unity3D has a WYSIWYG approach with actions built in for physics.
Cocos2D allows you to use several different physics libraries including the one in Unity3D.
Youtube Cocos2d iphone box2d and chipmunk - mix the tags up
One nice thing about 2D art in cocos is SVG and tiles - see this tutorial / video - not much work - not much at all.
http://www.youtube.com/watch?v=yvZM-YPPbII
Cocos is actual simple - it is python and the documentation is poor - however there are plenty of small open source games out there using cocos - a quick google code search will reveal a few - open one up in xcode and it becomes quite clear and if you are a developer who knows an actual programming language it should look as easy as html form there.
I am convinced after working on several projects opening a few games that are out there will make complete sense of all of it.
I don't know much about Unity3D. But I know of a very nice game engine witch you can use it's called Game Maker. I think it's very useful for the inexperienced/solo game developer. With it you should be able to create good quality games in about two to three months. The last I checked it's about $20 for the full version of the software. So, I guess it's light on the wallet too.
2D games are easy with Unity. Its as simple as changing the view mode of the camera. Technically the game is still 3d but seen as 2d. If your looking to solo make a game in a short time then Unity is the way to go. Unity can make a 2d game for a iPhone to a super advanced MMO. Also there are hundreds if not thousands of tutorials out there that can teach you pretty much anything you need to know.
Unity is easy to make games for every platform and gets rid of the heavy lifting. I like Unity because you see the results fast and its cross-platform compatibility.

Quartz 2D vs OpenGL ES Learning Curve

I have been developing iPhone Applications for a couple of months. I would like to know your views about the Quartz vs OpenGL ES 1.x or 2.0 learning curve. You can tell your perspective. My Questions are
*I am a wannabe game developer, So is it a good idea to first develop in quartz , then move
on to OpenGL ES or does it not make an difference
*Can you please tell your experiences when you were having the similar question
Thanks :)
Quartz 2D is not applicable for game development IMHO. It is a software rendering API. It won't give you realtime rendering speed. It's good for drawing charts or vector text with shadows, or for blending several images together. Just not for games. Unless you want to make a game where few images are moving against a monochrome background and even in that case I doubt it will be really smooth on older devices. I've seen some games obviously coded with Quartz. A pitiful sight.
Sooner or later you'll end up using Open GL ES or a game framework build on top of it. I recommend you to check cocos2D, SIO2 engine, or examples from SDK.
With careful programming it is possible to make an Open GL ES game with parallax scrolling and relatively small amount of objects work at 60 FPS even on 2nd gen devices. Tiny Wings is an example of such game. And maintaining stable 30 FPS is not a problem at all.
I skipped Quartz and went right to OpenGL ES. I started with a 2D sprite based game. Thought it was pretty easy.
The key is having a good example to look at. I used the Lunar Lander clone (Crash Lander), but I don't think that's easy to find anymore. Maybe someone who has done it recently knows of a better, newer example that uses current best practices.
I'm in the same boat as you describe, although I have no programming background. (Although I don't know what your background is either) Currently, I am in the process of learning to code as I learn the various API's that are available. I'm an objective-c guy going backwards to the c-based Quartz API, and it's a little bit of a challenge. Luckily, Programming in Objective-C 2.0 by S. Kochan has a great chapter on underlying C features to keep you afloat.
I have taken a couple of stabs # OpenGLES, and I have to say, that from a conceptual standpoint, I'm not ready for it. The Quartz2d API is a bit easier to learn conceptually because it's very easy to get up & running with a few commands. Right now, I'm at the point where I can define shapes and point to point images with out too much trouble.
OpenGLES is going to be something in my future, but it takes such an enormous amount of code to configure the drawing view, set up buffers, etc. If you are familiar with everything the code is doing, then it's a bit easier. However, from a learning perspective, Quartz is an easier way to get going, quickly.
Resources I'm using: The aforementioned book, and an anemic amount of blogs containing tutorials, which are limited # best. At this point, make an appointment with the apple docs and get cozy, because it's about the best (free) stuff that's out there (& exhaustive) With that said, I'd love for someone to prove me wrong on this site by posting a great resource for learning, but that's about it. Good Luck.
I have been looking for the fundamental differences so I can decide between OpenGL (ES) or Quartz or a hybrid. The good news is that the hybrid is an option. Clearly Quartz is easier to master for O-O programming and the answer from Apple appears to be that OpenGL, "...is ideal for immersive types of applications..."
http://developer.apple.com/library/ios/#DOCUMENTATION/General/Conceptual/Devpedia-CocoaApp/DrawingModel.html
I don't want to limit the category to games as I believe any game UX can be applied to a business App, a productivity App, entertainment viewing, etc. By the same token, I fully expect the technology (both h/w and s/w) to advance to make either a choice.

What do I have to learn to get done with a 3D racing game for the iPhone? What Tools do I need?

I know Java pretty well. I know now most of the Basics in Objective-C.
I know nothing about Photoshop. I know how to use TurboCAD 10 Professional, so I do have some experience in 3D object modelling. Although not much.
What do I have to learn step-by-step, to come to 3D game Development for iPhone? What Tools do I need? Which Books help out? How long did you learn?
Learning the basic ins-and-outs of OpenGL ES on the iPhone took me about 3 weeks. I post some of my observations on the subject here. The source code to my Molecules iPhone application, which uses OpenGL ES, is available here. Maybe you'll be able to find something useful in that example. However, there's nothing in there that deals with textures, which you'll probably need for your game. Bill Dudney has posted source code for a Wavefront OBJ modeler on the iPhone that may help in that regard. For a good text on OpenGL ES, I'd recommend "Mobile 3D Graphics: with OpenGL ES and M3G".
When it comes to Cocoa development in general, it will take you a little while to get up to speed. For me, it was about 6 months before I felt comfortable with it, although that was in the more complex Mac desktop environment. I post some resources for learning Cocoa here, although that's by no means an exhaustive list.
I agree with diciu, this is a bit much for someone just starting out on the platform. I'd find a simpler application or series of targeted applications (that you may never even release) to help you learn the core concepts before you leap into 3-D game design.
Your goal is very ambitious - I think it's a very hard project to tackle as the first project on the iPhone and you'd be better off starting out with a couple of simple Cocoa touch applications to get a feel for the platform.
For a simulation game I would start with experimenting with some physics engine such as bullet. Bullet is C++ and you can use it from Objective-C++.
For rendering 3D you probably want to use OpenGL ES.
I guess that OpenGL is worth a look.