You can watch the promotional video here:
The game features 3 different minigames, suitable for kids of all ages:
- Jigsaw puzzle game
- Memory-like game
- Paint application
Diary of a game programmer
Basic reference of my understandings of how to batch geometry on the POWERVR SGX chip.
Render Target 1
1. Opaque surfaces
No win to sort by depth.
2. Surfaces using discard (Old Alpha Test)
Same sorting as Opaque Surfaces
3. Transparent surfaces
Sort by depth if necessary
Same sorting as Opaque Surfaces
Render Target 2
…
Consider the following code:
int Test()
{
int a=10;
int c;
// Bug. User meant “=” but unfortunately wrote “==”
c==a;
return c;
}
This piece of code is obviously faulty. c is never assigned the value of a. c is actually never assigned any value.
When we compile this in VS 2008 we get the following warnings:
In Xcode, we get no warnings at all. I just spent 30 minutes tracing this kind of bug in my code, in Xcode. I know I have made the mistake of replacing “=” with “==” several times in the past, but usually VS warns me in these occations. Xcode does not.
Coming from an OpenGL 1.5 + Nvidia Cg environment there are some noticable differences when migrating over to OpenGL ES 2.0. This post is like a cheat sheet for myself and others to use as a quick reference to look up some major keypoints of the Opengl ES Shading Language.
Precision & range of variables
The OpenGL ES Shading Language, used in e.g. IPhone OpenGL ES 2.0, lets you decide upon the range and precision used to represent integer or floating point variables.
Bits | FP Range | FP Precision | Int Range | |
highp | 16 | (-262, 262) | Relative 2-16 | (-216, 216) |
mediump | 10 | (-214, 214) | Relative 2-10 | (-210, 210) |
lowp | 8 | (-2, 2) | Absolute 2-8 | (-28, 28) |
Notice the fragment shader is missing a default precision for float. This means you must include precision qualifier for floats.
Built-in Variables
Type | Precision | |
gl_Position | vec4 | highp |
gl_PointSize | float | mediump |
Type | Precision | |
gl_FragCoord | vec4 | mediump |
gl_FrontFacing | bool | |
gl_FragColor | vec4 | mediump |
gl_FragData[gl_MaxDrawBuffers] | vec4 | mediump |
gl_PointCoord | vec2 | mediump |
3G | 3GS | 4 | IPad | |
Resolution | 480x320 | 480x320 | 960x640 | 1024x768 |
Ratio (*) | 3:2 (1.5) | 3:2 (1.5) | 3:2 (1.5) | 4:3 (1.33) |
OpenGL ES | 1.1 | 2.0 | 2.0 | 2.0 |
(*) The bigger the ratio the more “widescreen” the display is. Eg: 16:9 = 1.78, 16:10 = 1.6