Using GLSL shaders in cocos3d

Why are you here??
 
Visit the wiki article that covers this topic on the new, shinier, and vastly improved Cocos3D website, instead!!


cocos3d is a sophisticated 3D application development framework for the iOS and OSX platforms. With the release of version 2.0, cocos3d now supports cocos2d 2.x and OpenGL ES 2.0 under iOS, and OpenGL under OSX, including the use of GLSL vertex and fragment shaders. This document provides an introduction to writing and using GLSL shaders within cocos3d.

Continue reading Using GLSL shaders in cocos3d

Cocos3D Importing: Generating POD Files

Why are you here??
 
Visit the wiki article that covers this topic on the new, shinier, and vastly improved Cocos3D website, instead!!


Cocos3D is able to directly import files formatted in the PowerVR POD file format from Imagination Technologies, the supplier of the GPU used in iOS devices. The POD format is a dense binary format, suitable for the fast loading and minimal memory requirements of a mobile device.

This article describes how to generate a POD file, either by exporting directly from one of several popular 3D editors, or by converting a COLLADA file previously exported from a 3D editor. COLLADA is an industry-standard exchange format for specifying 3D model data, and most 3D editors support exporting into the COLLADA file format.

Continue reading Cocos3D Importing: Generating POD Files

Cocos3D Development Roadmap

Why are you here??
 
Visit the wiki article that covers this topic on the new, shinier, and vastly improved Cocos3D website, instead!!


This post outlines the intended release of new features and functionality to Cocos3D. Continue reading Cocos3D Development Roadmap

cocos3d Programming Guide

Why are you here??
 
Visit the wiki on the new, shinier, and vastly improved Cocos3D website, instead!!


The cocos3d framework is a sophisticated 3D application development framework for the iOS platform. This document describes the framework components and provides guidelines and best practices for building cocos3d iOS applications. Continue reading cocos3d Programming Guide

Adding SIO2 to an Existing Xcode iOS Project

Updated (2011/01/16) – Please note that this article covers SIO2 v1.4, which was the original free/low-cost version of SIO2. This article does not cover SIO2 v2.x.

SIO2 is an interesting and useful library for building 3D OpenGL ES applications under Apple’s iOS. While not strictly object-oriented like Apple’s Cocoa, much of the OpenGL functionality is abstracted into a collection of useful structures and related higher-level functions.

For historic and performance reasons, SIO2 is written in C++, not Objective-C. Bridging between pure C++ and Objective-C is not always as straightforward as it should be, and there are a few things to take into consideration when combining C++ libraries with Objective-C.

To aid with that issue, SIO2 comes with a customized Xcode template project, which provides a stable base for beginning the development of an iOS application that combines the SIO2 library with Objective-C and Cocoa. However, it’s not always practical or even recommended to begin all Xcode projects from the SIO2 template, and if you already have an existing Xcode project, it can be a challenge importing the SIO2 library into it. This article outlines the steps needed to import SIO2 into your existing Xcode Objective-C project. Continue reading Adding SIO2 to an Existing Xcode iOS Project

cocos2d and UIViewControllers

This cocos2d framework package is a wonderful framework for working with OpenGL ES within iOS. Since it focuses on high performance OpenGL ES code, for the most part cocos2d bypasses Apple’s Cocoa UIViewController hierarchy. This makes sense, since within iOS, OpenGL ES usually plays out on a single UIView, and typically in a single display orientation, so there’s usually not much to control.

However, there are occasions where the functionality provided by UIViewController can be quite useful. In particular, the following functionality is best handled by adding a UIViewController into the mix:

  • Auto-rotation – in some games, or other OpenGL ES applications, it makes sense to change the orientation of the application display to match changes in the orientation of the physical device. This means that when the user flips the device from landscape to portrait mode, or back again, the application display will adjust itself accordingly. The auto-rotation works on cocos2d nodes directly and does not rotate the underlying iOS Cocoa UIView. If you are interested in combining cocos2d nodes with UIViews and having them auto-rotate together, please review cocos2d support for that here.
  • Device camera overlay – an increasingly popular use for iOS devices is to overlay a game or app view on top of the image visible through the device’s camera. This is known as augmented reality, and provides the user with a combined view of the real world overlaid with images generated by the application. For this use, a UIViewController is mandatory, since it controls the merging of the real-world and generated image streams.

Here at The Brenwill Workshop, some of our iOS applications actually use both of these features, and we’ve developed a small framework that can easily add the capabilities above to any cocos2d application. This article describes the design and use of this framework.
Continue reading cocos2d and UIViewControllers

cocos2d UI Controls

This cocos2d framework package includes several useful cocos2d user interface controls and frameworks, including:

  • Joystick – a flexible joystick for user control in two dimensions with a single finger
  • CCNodeAdornments – a framework for assigning adornments to CCNodes to temporarily change the appearance of the CCNode, such as scaling, fading, adding visual embellishments, etc. This is most useful when used with menu items to temporarily change the appearance of the menu item during user selection.

Continue reading cocos2d UI Controls

Flexible iOS Logging

Apple’s Cocoa SDK framework for the iOS provides basic logging capabilities through the NSLog function. This allows the developer to log simple text messages to the development console.

However, the use of NSLog suffers from two drawbacks:

  1. There is only one level of logging with NSLog. So during development, you get a record of all of the NSLog calls that you’ve inserted, some of which might be quite detailed and frequent, and it’s easy to be overwhelmed by the clutter. There is no way of selectively turning off some of the output.
  2. The NSLog function is called every time it is encountered, including within executing production release code. To avoid this, developers must typically remove all calls to NSLog before compiling for a production release. This is a headache fraught with possible mistakes and inhibits debugging future releases.

To remedy this, we’ve developed a logging framework that solves both of these issues. This library consists of a single Logging.h header file which adds, to iOS, flexible, non-intrusive logging capabilities that are efficiently enabled or disabled via compile switches. Continue reading Flexible iOS Logging

Colophon

I thought I would describe how we constructed this site. There are a lot of useful site-construction tools out there, and it’s always useful to see what works for a particular site. Continue reading Colophon