GLKit.framewok vs OpenGLES.framework vs QuartzCore.framework - ios

I am adding a GLView to my app and along the way I have learned that I need to add the GLKit framework.
So when I was adding this framework, I realised there is a very similarly named framework called OpenGLES.framework.
I tried to look up the difference between these two frameworks on google, and I landed on this page.
This article seems to suggest I need an extra framework called QuartzCore.framework, which confused me even more.
I have the following questions:
1) How do these frameworks relate to each other?
2) It seems like GLView framework alone will enable GLView to work. When am I required to use the other two frameworks?

OpenGL ES is a cross-platform C API for GPU-accelerated drawing, particularly useful for 3D graphics and image processing. On iOS, you link against OpenGLES.framework, providing access to the cross-platform API and to the most basic iOS-specific APIs (EAGLContext and CAEAGLLayer) for using OpenGL ES in your app.
GLKit is an Apple-specific framework that adds extra features for making development of OpenGL ES-based apps easier, as nicely summed up in the tutorial you linked to:
GLKView/GLKViewController. These classes abstract out much of the boilerplate code it used to take to set up a basic OpenGL ES project.
GLKEffects. These classes implement common shading behaviors used in OpenGL ES 1.0, to make transitioning to OpenGL ES 2.0 easier. They’re also a handy way to get some basic lighting and texturing working.
GLMath. Prior to iOS 5, pretty much every game needed their own math library with common vector and matrix manipulation routines. Now with GLMath, most of the common math routines are there for you!
GLKTextureLoader. This class makes it much easier to load images as textures to be used in OpenGL. Rather than having to write a complicated method dealing with tons of different image formats, loading a texture is now a single method call!
If you link GLKit.framework, you get OpenGLES.framework for free — likewise if you import the GLKit headers, the OpenGL ES headers come along for the ride.
QuartzCore is for working directly with Core Animation layers. Before GLKit was introduced, you had to set up your own layers for getting OpenGL content onscreen — now GLKView does this on your behalf, so there's no need for QuartzCore unless you want to do extra fun stuff with Core Animation.

Related

Easiest way to display text in OpenGL ES 2.0

I'm creating a simple Breakout style game and would like a simple way to display the score.
I've been doing some research and found several ways to do text in OpenGL ES, but most methods look fairly complicated.
This looks like it would do the trick, but I couldn't get it to work.
I've looked into FTGL and FreeType, but they look complicated.
I've also read one can display a UILabel over the EAGLContext, but not sure how that would be in the performance department.
I could probably get any of these options to work, I'm just wondering what the best solution is for this situation.
For simple use cases like you're describing, on even vaguely modern hardware (i.e. iPhone 3GS and later, I think), the compositing penalty for layering UIKit/CoreAnimation content on top of OpenGL ES content is negligible. (You can see this if you run your app in Instruments with the "Color OpenGL ES fast path blue" option turned on.)
They say premature optimization is the root of all evil — it's pretty easy to try UILabel, see if it makes a significant difference to your app's performance, and look into third-party libraries and more complicated solutions only if it does.
(Also, it sounds like you might be trying to manage your own CAEAGLLayer. For common use cases, it's a lot easier to use GLKView, plus GLKViewController for animation.)
I'd recommend checking out the Print3D functionality of the PowerVR SDK's PVRTools framework. Print3D is free to use, cross-platform (iOS, Android, Linux, Windows, OS X etc.) and it efficiently renders text within OpenGL ES 1.x, 2.0 & 3.0 applications. The SDK includes an example application with source that demonstrates how to use the Print3D framework (IntroducingPrint3D).
The PowerVR Graphics SDK can be downloaded for free from Imagination's website: http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
An overview of the source included in the SDK can be found here: http://www.imgtec.com/powervr/insider/sdkdownloads/learn_more.asp

How can I load a 3d model to an IOS app, and scale/transform/rotate it to place on an image?

I should load a 3d model (let's say a fridge) and scale or rotate it to locate on a kitchen photo (just for an example).
I have seen several SDKs but all was for 3d games. What I need is to put and play with my object in a native IOS app.
Where should I start? GLKit is the answer for that?
iOS 3d rendering is made by OpenGL ES, that is a pretty difficult topic. Apple provides GLKit to help developer to integrate OpenGL ES but none of is a model parser or scene manager, is hard anyway. I can suggest you to use a 3d engine, I took a look at two engines:
1-Nineveh GL
2-Irrlicht
The first integrate absolutely fine in iOS projects and exposes objective c API. It uses only OpenGl 2.0 shaders. The problem is that is a beta version.
The latter is written in C++ and supports both 1.0 and 2.0, but is pretty hard to integrate.

What strategy is thoughtful to evaluate WebGl-Based APIs?

Since there are lot of high level APIs , libraries and Frameworks available for webGL for developing 3D web applications, I want to select the best (sorry this is bit straightforward) to implement a particular model (which isn't Game oriented) on web. I'm confused how to approach for my work, The criteria I want to use for evaluation is:
pickable objects, easily defined geometry and corresponding texture, multi-camera rendering, possible to incorporate GSLS implementations, type of buffers available.
I can't experiment and judge myself a framework by developing every single demo application in every framework due to time constraint. Is there any particular way to read the documentation for available APIs which mention all these. Moreover, the problem is every framework says they are good in some part and how to overcome this to justify single framework among all those available in net world.
A suggestion would suffice my research...
If you have Maya at hand then www.inka3d.com is easy in terms of defining geometry and texture (because you do it with Maya and your favorite image editor) and you get pickable objects. For shaders you can't use glsl but have to use Maya's node based shader editor.

NURBS surfaces in OpenGL 3.2 core profile

Is it possible to draw NURBS (Non-uniform rational B-spline) surfaces in OpenGL 3.2 core profile?
I assume that the NURBS rendering using GLU library does not support the core profile.
Is there any open source libraries that implement the same functionality as GLU?
Using GLU with core profiles from OpenGL 3.1 onwards, won't really work. GLU is layered on top of a many deprecated OpenGL functions, and your application most likely won't either link or work correctly.
As for NURBS implementation in GLU, the source code is available in the open source from SGI at http://oss.sgi.com/projects/ogl-sample/. You could probably fix the library to use more modern OpenGL methods.
Also more details are given in this post.

2D games on iOS

This is something I've pondered/struggled with and would love to hear some opinions on. I have a good deal of familiarity with the iOS sdk but not so much with the opengl related aspects and not really any with the various SDKs, especially game SDKs build to work on iOS.
If I want to create 2D games for iPhone/iPad, is it easy/better/practical to use some simple collection of iOS SDK objects such as the UIImageViews etc to build a plethora of sprites interacting on the screen, or much better to go with an SDK for that? I'm assuming that going with gl is overboard for 2d requirements, but please voice any dissent if I'm wrong there.
I'm mainly interested in what the quickest route to getting things done is, combined with the smallest requirements to ramp up on technologies. Obviously if it is well worth it to use an SDK simply because it is cross platform for other OSs, that is reasonable to mention.
The advantage of using a framework on top of OpenGL can greatly increase productivity, maintainability and reduce programming errors.
Personally I work with cocos2d-for-iphone. It's written in Objective-C and is based on top of OpenGL. It was created with the aims to create 2D games and thus unlike UIKit or QuartzCore, it's designed for that. It provides a lot of convenience API to manage scenes or sprites, to create animations, etc. Or even libraries for the sounds for example.
There is a very good article which describes some open-source game engines available on iphone here. It could help you in your search.

Resources