While the PlayStation 3 (PS3) version of the SpeedTree SDK is a full port, from the Core library all the way to the full Reference Application, the developer can still choose any level of integration that makes sense for their title. An integration can range from importing meshes, skipping the SDK entirely, to using the entire SDK to handle loading, culling, rendering, and animation chores.
There are VS2010/VC10 solutions in the [SDK]/Source/Applications/PS3/ folder. These solutions contain all of the SpeedTree PS3 projects: Core, Forest, Render Interface, PS3 Renderer, and Reference Application. Individual projects and solutions are available in each of the libraries' directories. These projects use the SN Systems ProDG tools.
The PS3 Renderer uses libGCM for rendering commands. Helper utilities from the gcmutil library from the PS3 SDK are also used.
Of all the source that is provided, only the SDK files are intended to be used with your title. All of the code in MyApplication.h/cpp, MyMainPS3.cpp, as well as the rest of the code in the SpeedTreeRefApp_PS3 project, are intended to be examples of how to interface with the SDK. Use as much or as little of these files as you like, but pay particular attention to which calls are made when, especially in the population, culling, and rendering sections of the CMyApplication class.
SpeedTree's portable Reference Application uses SFC files to create the environment. An example SFC file is included for the PS3 at “[SDK]/Bin/Forests/Meadow/ps3.sfc”. By default, as defined in CMyCmdLineParser::Parse() in MyCmdLineOptions.cpp, the project will right as if the following option was given:
|Note: When running from Visual Studio, be sure to also set the home directory in the ProDG VSI Project Properties (Configuration Properties / Debug/Tuner / Home Directory) to the [SDK]/Bin directory, NOT the executable directory.|
The controls when running the Reference Application are as follows:
|Left Shoulder 2||Move Light|
|Right Shoulder 2||Move Faster|
|Left Shoulder 1||Toggle Terrain Following|
|L3 + R3||Quit|
The PS3 Renderer Library loads only textures in the GTF format. See the PS3 SDK documentation for more information on this format. The SpeedTree Compiler has the ability to export textures in the GTF format, or a tool such as the dds2gtf in the PS3 SDK can be used to convert textures.
Since texture filenames are stored in the SRT file, it may be cumbersome to keep two different versions of SRT files - one for use on PS3 and one for other platforms. For this reason, there is a CONVERT_TEXTURE_EXTENSIONS_TO_GTF convenience macro at the top of PS3Renderer.h. Enabling this macro will change all texture filename extensions to GTF before loading, enabling the use of the same SRT files on all platforms.