Friday, May 13, 2011

Learning OpenGL ES 2.0 by Baby Steps

When create a openGL ES 2.0, you will get AppDelegate, xib file, shader.fsh&shader.vsh, EAGLView.h&EAGLView.m, and viewController.

Inside your AppDelegate, there should be a UIView and all the other control should be inside the viewController.

kEAGLRenderingAPIOpenGLES1 or kEAGLRenderingAPIOpenGLES1 decides whether app supports OpenGL ES 1.0 or OpenGL ES 2.0

OpenGL initialization should be in EAGLView file.

glLinkProgram links the shader.

Apple recommends set eaglLayer.opaque = true.

iPhone's refresh rate: 60/second.

ratio: 320/480. iPhone's original point is in upper left corner. OpenGL ES set original point in the middle of the screen: 160/240.

OpenGL ES can only draw Triangles. Triangles, Triangle_Strip and Triangle_Fan.

iPhone's aspect ratio: 1:1.5. So be careful about drawing square on the screen.

Make changes:
if change uniform in shader, things need to be changed:
1. Uniform index, enum in ViewController
2. drawFrame
3. loadShaders
4. in your shaders.

According to the Khronos group’s ‘The OpenGL ES Shading Language’ specification 1.0.17, the minimum number of uniform vectors a vertex shader should support is 128, and the minimum number of uniform vectors that a fragment shader should support is 16.

Attribute support is even more limited, with a minimum of 8 attributes in a vertex shader. When I say ‘a minimum of 8’, that means that the implementation of OpenGL ES is free to support more than 8, but it must support at least 8.

Sunday, April 10, 2011

When to Make a Subclass

Found this really useful during the reading:
"First, know the framework. You should become familiar with the purpose and capabilities of each class in the framework. Maybe there is a class that already does what you want to do. And if you find a class that does almost what you want done, you’re in luck. That class is a promising superclass for your custom class. Subclassing is a process of reusing an existing class and specializing it for your needs. Sometimes all a subclass needs to do is override a single inherited method and have the method do something slightly different from the original behavior. Other subclasses might add one or two attributes to their superclass (as instance variables), and then define the methods that access and operate on these attributes, integrating them into the superclass behavior."

http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CocoaFundamentals/AddingBehaviortoaCocoaProgram/AddingBehaviorCocoa.html#//apple_ref/doc/uid/TP40002974-CH5-SW22

P.S. it is really unfortunate that the book: "Designing Gestural Interfaces" is only PARTIALLY online unless you register for a free trail. Chapter3 looks really interesting.

Easy and Pretty = Pretty Easy?

"Perceived usability is important because people will report higher satisfaction with an application based on how aesthetically pleasing the system looks to them. Users will commonly assign positive qualities to systems they believe are physically attractive, known as the long-held belief that what is beautiful usable - even if the system isn't usable at all (Tractinsky 2000)". This result is kinda surprising. I would assume "easy to use" and "aesthetics" were totally two separated things. How could they have influence on each other? But then, here is the result, which just moves the appearance of user interface into a higher rank in your application design system.

"It is important then to balance aesthetics and usability to ensure user interfaces are not only easy to use, but that they are also visually appealing and interesting too." Give a second thought, there are tons of applications out there in the world, and it is absolutely true that when I choose to buy an app, the first thing I've noticed besides the reviews would definitely be the interface and graphic. So if you want to make a competitive application which can "fight" itself through, a smart, creative, interesting interface is a MUST.

http://www.carrielee.net/pdfs/HCIAesthetics.pdf

Saturday, April 2, 2011

"Neat, but useless, and no more free."

"Gravilux, Bubble Harp and Myrmegraph", I believe these are a very nice and fun apps. But after playing with it for 15 mins, I got bored, yes, even it is such a brilliant application and took years of working. I love conceptual art and creative media projects, but besides that, I always hope that it gives us more. More than a 15 mins experience and a good memory. It is a question for me, how to upgraded all these extraordinary apps into a more "useful" product.

http://www.snibbe.com/blog/2010/05/19/art99/

how to benefit from touch-screen

"Remember that it took 30 years between when the mouse was invented by Engelbart and English in 1965 to when it became ubiquitous, on the release of Windows 95.  So, by that measure, multi-touch technologies have 5 years to go before they fall behind."

According to Bill Buxton's theory, multi-touch technology still have 5 years to go. What can we benefit from multi-touch screen? I personally found type on an iphone is actually pretty painful. From a typing perspective, I would rather go for a key board. I believe the advantage for a touch device like iphone or ipad is the continuous touch action and degrees of freedom. Which makes me think what is a petter game or app for a touch device like that. For me, it will be use less and less buttons, require less typing action,and use more and more slider or tracking function.

http://www.billbuxton.com/multitouchOverview.html