Porting Desktop OpenGL to iOS

Dr David Barnes, Monash University

Audience: Intermediate to Advanced (Assumes experience in OSX or Unix and iOS programming.  Experience with desktop OpenGL highly recommended)


The iOS platform supports contemporary, best-practice 3-d graphics programming using the ubiquitous OpenGL API.  The latest iOS hardware – iPad2 – delivers astonishing rendering throughput for both fixed-function (OpenGL ES 1.1) and fully-programmable (OpenGL ES 2.0) pipelines.

While many iOS OpenGL ES apps are written from scratch, it is feasible and often reasonably straightforward to migrate existing desktop OpenGL code to the iOS platform, and proceed to build desktop and iOS products from a single code tree. In this talk, we will present and discuss:

  • an overview and comparison of the desktop (OpenGL + GLUT) and iOS (OpenGL ES + CocoaTouch) paradigms for delivering 3-d graphics in the model-view-controller world;
  • a basic recipe for restructuring desktop OpenGL code to enable co-development for the iOS platform (fixed-function pipeline);
  • a checklist of *code* changes necessitated by the move from OpenGL to OpenGL ES;
  • a checklist of *code* changes needed to migrate GLUT controllers to CocoaTouch controllers (e.g. handling touch events instead of mouse events); and
  • a checklist of *paradigm* changes necessitated by the change from the desktop platform to the iOS (touch) platform (e.g. navigating the 3-d scene).

If time permits, a brief commentary on transitioning from the fixed-function pipeline (OpenGL ES 1.1) to the fully-programmable pipeline in OpenGL ES 2.0 will be made.  The talk will draw from the presenter’s experience in migrating a high-level desktop OpenGL library (S2PLOT) to the iOS platform, and numerous code snippets will be shown and discussed.

Speaker Bio:

Dr David Barnes, has recently moved from the Centre for Astrophysics and Supercomputing (at Swinburne University of Technology) to Monash Biomedical Imaging (MBI) at Monash University.

At Swinburne, David was senior research fellow in visualisation and astronomy, and was responsible for developing and supporting scientific visualisation within the Centre.  David’s major accomplishments at Swinburne are incorporated in the latest/forthcoming release of the S2PLOT library – a high-level API for interactive, 3-d, scientific graphics on Linux, Mac OS X and iOS platforms. S2PLOT supports stereoscopic display devices, sophisticated user input (e.g. 3-d handles; remote control via iOS devices), and can create 3-d PDF figures.  S2PLOT version 3.0 will be Free Software, released under the GPL, and will include partial support for deployment on iOS.

David also lead the adoption of Graphics Processing Units (GPUs) for science and high-performance computing at Swinburne. Using both the NVIDIA CUDA and OpenCL language extensions, David and his research team have published world-best results in GPU computing including the realtime ~50fps volume rendering of a 220GB 3-d image using a GPU-equipped HPC facility (Hassan et al.,2011), desktop teraflop computing for gravitational lensing calculations (Thomson et al., 2010) and the ~25x speed-up of dedispersion code to enable real-time transient detection at the Parkes Radiotelescope (Barsdell et al., 2011).

At Swinburne, David developed and lectured the subject “HIT 4326 Data Visualisation” in 2011.  At Monash Biomedical Imaging, David will be Computational Imaging Scientist, supporting visualisation-led discovery for e.g. neuroscience, and high-performance GPU-based image analysis.

Leave a Reply

Your email address will not be published. Required fields are marked *