Elastic Image Software
iOS Software Development and Training. iPad. iPhone. iPod Touch.
Creator of Beautiful Panoramas. Stunning, 360 degree panoramas on the Apple iPad.
Available in the App Store now >>.
Posts
Since there is no preferred device orientation for iPad, OpenGL rendering on the device must handle that. I have added arbitrary device orientation to my HelloiPadGLSL code to demonstrate how to handle that. It turns out to be relatively easy if you think in terms of the MVC design pattern Apple has established and implement the proper methods in your Controller and View. I include liberal doses of NSLog-ing to stare at for your pleasure:
On GitHub: http://github.com/turner/HelloiPadGLSL
Enjoy,
Doug
twitter: @dugla
To fully exploit the graphics potential of iPad you need to get comfortable with the OpenGL shading language. Cool kids call it GLSL. Think Pixar RenderMan shading language in realtime. As I mentioned in a previous post on this blog and in my meetup presentations to iPhone devs, this will take your visuals (both 3D and 2D) to an entirely new level in terms of visual complexity, realism, and sheer visual expressive horsepower.
In acronymn land iPad takes us from OpenGL ES1 - the version of OpenGL running on iPod Touch and iPhones - to OpenGL ES2. Note, iPhone 3Gs actually supports OpenGL ES2 as well.The expressive power of GLSL comes at a price. It raises the degree of difficulty significantly and is not for the faint of heart. To help ease your transition from pre iPad OpenGL I have written HelloiPadGLSL. On GitHub here: http://github.com/turner/HelloiPadGLSL. If your team is interested in unlocking the expressive beast that is GLSL you will want to get comfortable with this code. I am also available to work with and/or train your iPad development team to get the most out of 3D graphics on iPad.Cheers,Doug
twitter: @dugla
Thanks to all the NYC iPhone devs and enthusiasts that attended my talk.
Presentation deck on SlideShare:http://bit.ly/Y1MW8
Sample code referred to in the slides is available on GitHub:
http://github.com/turner/HelloTexture
http://github.com/turner/HelloTeapot
Tweets related to this talk us hashtag: #iphone3dnycmu
Regards,
Doug Turner
I tweet as: @dugla
Email me: douglass dot turner at gmail dot com
There are two apps you will want to install on your iPhone/iPodTouch and/or run in the simulator on your Mac during this tallk.On GitHub:
Cheers,
Doug
@dugla
Relax. My point is that OpenGL is not a particularly insightful way - a rather unpleasant way actually - to learn about one the most enjoyable, creative, and deeply satisfying software development fields you will find. OpenGL is a specification. OpenGL is a state machine manipulation language. Coming from Mac/iPhone and the warm, and supportive embrace of Cocoa/CocoaTouch, OpenGL will seem like a rude awakening indeed.
A good coping strategy is to read all the RenderMan books, papers, and DVDs you can get your hands on. RenderMan was invented at Pixar and is the development language used for all their films. Pixar/RenderMan is the gold standard for CG. There is Pixar and there is everyone else. Period. Baked into RenderMan is a very specific methodology about how to approach the task of making delicious pixels. There is a reason Cars looks so ridiculously georgous when played on a Blu-Ray disc and displayed on a 52" flatscreen display. The reason is RenderMan. It is best to think of OpenGL as your deployment language, sort of like assembly language. It's not particularly deep, you won't learn a hell of a lot about computer graphics pouring over example code, but its what we have to work with. Here is an excellent RenderMan paper to get you started: http://bit.ly/VkYwU
Easily the most comfortable place to begin your journey towards OpenGL for iPhone enlightenment is Jeff LaMarche's OpenGL From the Ground Up series of tutorials http://bit.ly/2ONFBJ. Jeff is a pro. He is smart and generous. This series is loaded with very approachable information, sample XCode projects and supporting 3D library code - texture and matrix - that will significantly accelerate your learning.
Jeff is author of the highly regarded Beginning iPhone 3 Development: Exploring the iPhone SDK http://bit.ly/1BfUSv
Jeremy Birn is perhaps the most lucid, most thorough, and most talented writer on CG lighting that you will come across. Here are two particulary insightful tutorials that reveal how the pros light their scenes. While not directly applicably to iPhone/3D, these are a gold mine for interesting visual f/x hacks to integrate into your apps:
- Lighting In Layers: http://bit.ly/dHc5H
- Render Passes, Layers, and 3D Compositing: http://bit.ly/2MAOYk
His CG Lighting Book is the best I've come across and probably the only one you will need: http://bit.ly/2a9Kj5
One of the challenges learning OpenGL on iPhone is the scarcity of 3D models, and model importers from the standard modeling tools such as Blender, 3DS Max, and Maya. An alternative is to use procedural surfaces. My personal favorite procedural surfaces are the RenderMan quadric surfaces. They are simple and have extremely flexible and clever u-v parametrizations that allow moderately complex shapes to be built by combining them. Importantly, they texture map nicely: http://bit.ly/3coAGa
A 3D rendering system and shading language I built implements the standard RenderMan surfaces in C++. Feel free to use that code as a starting point for your own implementation. It is available on GitHub here: http://bit.ly/1Zi4OM Refer to the Parametric Surface class:http://github.com/turner/theimageengine-render/blob/master/ParametricSurface.h
http://github.com/turner/theimageengine-render/blob/master/ParametricSurface.C
Rotation about z axis by 30 degrees with a fixed point of (1.0, 2.0, 3.0). Note matrices are pushed on the stack as we declare them so the last matrix declared is the first applied:
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(1.0, 2.0, 3.0);
glRotatef(30.0, 0.0, 0.0, 1.0);
glTranslatef(-1.0, -2.0, -3.0);
Here, we load and multiply by matrices explicitly defined elsewhere in the application program:
glLoadMatrixf(m)
glMultMatrixf(m)
Matrix m is a one dimension array of 16 elements representing the components of s 4 x 4 matrix stored in column-major order. Here, we read back a matrix from the GPU:
double m[16];
glGetDoublev(GL_MODELVIEW, m);
Vertices are pre-multiplied by the transformation matrix following the format in Richard Paul's Robot Manipulators >>.
Refer to this excellent presentation of OpenGL local, object, and eye space >>
Jim Blinn's Corner
- A Trip Down the Graphics Pipeline | http://bit.ly/3hD629
- Dirty Pixels | http://bit.ly/3dPOS
CG References & Tutorials | http://bit.ly/2uC4lc
OpenGL
- Super Bible | http://bit.ly/32sz5p
- Programming Guide | http://bit.ly/32sz5p
- Sample Code | http://bit.ly/ktQtA
- Sample Code | http://bit.ly/ktQtA
- Shading Language | http://bit.ly/2cXQUh
- Companion Website | http://bit.ly/2w7PY9
- Companion Website | http://bit.ly/2w7PY9
- OpenGL ES 2.0 Programming Guide | http://bit.ly/37tQsD
Physics for Game Developers | http://bit.ly/2B0G2h
Richard Wright's Math Library | http://bit.ly/1DJvAk
Digital Lighting and Rendering | http://bit.ly/2lGGBB
- Jeremy Birn (Pixar TD) website | http://bit.ly/1A6nMo
RenderMan
- Wikipedia | http://bit.ly/4yDzGC
- RManNotes | http://bit.ly/3wV1kg
- Essential RenderMan | http://bit.ly/p4YF7
- Companion | http://bit.ly/3pbJsj
- Shading Language | http://bit.ly/3tec1n
- Advanced RenderMan | http://bit.ly/2YVkko
Flocking (Often referred to as boids) | http://bit.ly/TI2iN
If you are attending the upcoming Acton iPhone Meetup talk: 3D Graphics for iPhone , we will use Twitter hash tag #iphonemeetup3dtalkacton for tweets related to this talk.
Cheers,
@dugla
douglass dot turner at gmail dot com
Updates
-
You Like beautiful? Who doesn't. 360 degree panoramas? Oh yah. Happy days. @beautifulpanos is free in the App Store. http://t.co/U4pAEt24
-
testing 123 http://t.co/ngxhmmKN #beautifulpanoramas
-
Did you miss Woodstock? Did your parents? Go get our just release On The Way to Woodstock app. An App Store App of the Week. Peace, baby.
-
Nokia CEO Elop "burning platform memo" http://t.co/qJDb8SS. NOK's suffocating consensus culture is at the root. Sadly, very Finnish.
-
@AmyCueva Hi Amy. We met a while back. Apple alum? Now full-time iOS dev. Working with MGH on very cool mobile radiology app. What up?
-
@MadPow Hi Amy. Doug Turner here. We haven't talked in a while. I am focused on iOS app dev. Working with MGH on mobile radiology. Chat?
-
I joined The Brooklyn iPhone and iPad Developer Meetup on Meetup. You should too! http://meetu.ps/1QVx
-
@hugeinc You guys look like a fun/smart group. I just applied for the BKLN iOS dev role. My App Store baby: http://bit.ly/9KJBLA. Cheers.17 months ago from web | Reply, Retweet, Favorite
-
I am enjoying iOS consulting with a great team at Massachusetts General Hospital. Taking radiology to the iPad in a big way.
-
@andrewwillmott Hi Andrew. When you have some time I'd like to chat with you about a GPU/GLSL rendering idea I have for iOS apps. Cheers.
-
@jeff_lamarche Whoa! I've been buried in client work and missed your tweets. Thanks for the assist. Cool.
-
@jeff_lamarche ... Lots of folks have found my Hello World GLSL code on GitHub helpful: http://bit.ly/aVSDD5. Cheers.18 months ago from web | Reply, Retweet, Favorite
-
@jeff_lamarche I'd be happy to contribute GLSL sample code for your upcoming iOS GL book. I'm doing lots of FBO GPGPU stuff now ...18 months ago from web | Reply, Retweet, Favorite
-
@elisabethrobson Thanks for the most excellent UISplitviewController tutorial on Youtube. More please ;-).19 months ago from web | Reply, Retweet, Favorite
-
@Dropbox caching? Y'all read my mind.
-
RT @appsfire: congrats to Beautiful Panoramas in the top 100 free iPad apps, reaching top 50 - in less than 3 hours http://flic.kr/p/8DaLq5
-
Great news! @appsfire is now promoting a one (1) day free offer of Beautiful Panoramas: http://bit.ly/9KJBLy . Enjoy.
-
@360cities, interested in demoing a pre-release version of Beautiful Panoramas? 360 deg. panoramas on iPad. See: http://bit.ly/dj9sb9
Answers
-
Are you interested in having me help you create such an app?Asked by Formspring 18 months ago
-
Hi, Unfortunate!y that is not possible in this app. It was designed present the work of the panoramic photographer Will Pearson.Asked by Formspring 20 months ago
Ask a question
Posts
Elastic Image Software was founded by Douglass Turner. Douglass is an Apple alumnus and former member of the QuicktimeVR development team, the technology that introduced interactive panoramas to the world. Elastic Image Software provides software development services and training for the iOS platform in addition to developing imaging technology and applications for the iOS platform.