Table of Contents

Mac OSX Specifics

Platform Details

The Mac OSX port of the SpeedTree SDK and Reference Application is basically the same as the Windows OpenGL Reference Application. It uses the same code, in fact, since the platform-specific components are handled by the cross-platform OpenGL windowing library GLFW. All controls and behavior should be identical.

Note: The Mac OSX/OpenGL Renderer is currently in BETA. Performance will continue to improve. There are also a few known issues.

Building the SDK

There are xcode projects in the [SDK]/Source/*/MacOSX folders for Core, Forest, and Render Interface (the evaluation versions do not contain Core and Forest). The OpenGL Renderer and Reference Application projects are in the OpenGL folders. A workspace that contains all the projects is also in the Reference Application folder [SDK]/Source/Applications/OpenGL.

These projects were tested in XCode 4.0.1 in Mac OSX Snow Leopard and XCode 4.1 in Mac OSX Lion.


Running the Reference Application

The reference application can be run from the command line. Command line arguments and controls are identical to the Windows OpenGL Reference Application. To specify the forest config file, use the -sfc option as follows:

-sfc “../../Forests/Plantation/Plantation.sfc”

You can also specify command line arguments in the XCode project scheme for the application in the run section's “Arguments Passed On Launch”.


Mesh Instancing on OSX

Mac OSX Snow Leopard only supports up to OpenGL 2.1, and thus does not support mesh instancing. Each individual tree is rendered separately, which has a grea timpact on performance.

Mac OSX Lion has two OpenGL profiles it can support: compatibility and core OpenGL 3.2. With the compatibility profile, again only up through OpenGL 2.1 is supported. With the core 3.2 profile, OpenGL 3.2 and GLSL 1.5 are supported, which do support mesh instancing. In order to enable the Core 3.2 profile, enable the SPEEDTREE_USE_CORE_3_2_PROFILE define at the top of MyMainOpenGL.cpp. When this is done, the OpenGL renderer can detect that mesh instancing is available and will use it where it can. Note that the core 3.2 profile will not work in Snow Leopard.