User Tools

Site Tools


Xbox 360 Specifics

While the Xbox 360 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 and skipping the SDK entirely to using the entire SDK to handle loading, culling, rendering, and animation chores.


The 360 Solutions & Projects

There is a VS2010/VC10 solution in the [SDK]/Source/Applications/360/ folder. The solution contains five SpeedTree 360 projects: Core, Forest, Render Interface, 360 Renderer, and Reference Application. The Reference Application uses the AtgFramework provided with the XDK and its source is included in the solution as well.

Running the Reference Application

SpeedTree's portable Reference Application uses SFC files (SpeedTree Forest Configuration files) to set up and configure a fully populated world. By default, as defined in CMyCmdLineParser::Parse() in MyCmdLineOptions.cpp, the project will right as if the follow option was given:

-sfc "game:\forests\meadow\xbox_360.sfc"

The SFC contains everything necessary to set up the forest. Note that shadows are off by default. To enable the shadows, you'd need to recompile the Xbox 360 assets in the 360 SCS file with shadows enabled, then enable shadows in the SFC file. Note that our cascaded shadow system is merely a crude example compared to those normally used in shipping titles.

Controller To get around in the Reference Applications' world, use the following controls:


Architecture

There are a few files and classes unique to the 360 Reference Application. It is based on the AtgFramework, which is set up so that the client application inherits from ATG::Application. A new class, C360Application, is used for this purpose. It inherits from ATG::Application and wraps the portable CMyApplication class that defines the Reference Application's behavior.

MyMainXbox360.cpp houses main() which handles the highest-level operations:

  • The SpeedTree custom allocator object is defined in the global variable declarations, provided that ST_USE_ALLOCATOR_INTERFACE is #defined.
  • The C360Application is instantiated, which houses the main CMyApplication object that defines the Reference Application behavior at the highest level.
  • The command-line is parsed and the display is initialized according to options specified on the command-line.
  • The render loop is initiated with a call to atgApp.Run().
  • Upon termination, CCore::ShutDown() is called to free any remaining memory and finally, a memory report, detailing heap allocations made by the SDK since the application started, is written to st_memory_report_xbox360.csv if ST_MEMORY_STATS is #defined and the SDK has been build with it defined (off by default and in the evaluation as it slows performance).

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, 360Application.h/cpp, MyMainXbox360.cpp, as well as the rest of the code in the SpeedTreeRefApp_Xbox360 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.