Tools

Selective Update: Okay, what's that? Is it imposter-based rendering perhaps? If so, how accurate is the imposter? How much of a perf boost have some developers seen with it? Does it work with dynamic lighting?

Dan Amerson: Selective update is a run time technique that Gamebryo employs to minimize the amount of math that we do per object by skipping portions of the update process that have not changed from the previous frame. In the previous generation of PCs and consoles, it almost always resulted in a performance boost for developers. On current generation consoles, however, selective updating is often less relevant, as the cache behavior and branching behavior of the newer processors actually makes selective update slower than just doing the math again.

Particle Systems: Gamebryo implements exactly the same functionality as Max, which looks like a good way to help the artists - how do you go at keeping it fast with such a flexible system though?

DA: The Gamebryo particle system uses particle modifiers to achieve this behavior. From the artist's standpoint, particle systems set up within 3ds max or Maya look the same in Gamebryo. At the engine level, different options in the art packages produce different particle modifiers. These modifiers are orthogonal to each other; They can be added and removed independently from the list of modifiers on any given particle system. At run time, Gamebryo simply executes all of the modifiers on a particle system to update each particle. This structure gives us two benefits. First, we don't spend execution time dealing with options that the artist has not specified. Second, it allows our users to add custom behaviors to particle systems without having to modify the underlying library. All they have to do is attach a new particle modifier.

Shader effects: Let's say you wanted to replace the parallax mapping shader by a parallax occlusion mapping one for your next-gen rendering settings - is this basically as simple as a programmer writing that shader and setting the standard material's properties to use it instead when a certain user setting is on? What about render paths for consoles, is it similar?

DA: The Gamebryo material system is very flexible, allowing users to apply a range of materials through a variety of mechanisms. Here are a few approaches.

First, let's assume that a user has found a D3D Effect file online that implements parallax occlusion mapping. That .fx file can be easily integrated into Gamebryo using a library we provide that integrates D3D Effect files into the engine and art pipeline. With some minimal annotations to the file, artists could quickly apply that shader to an object, adjust settings and preview the effect within Gamebryo. The D3D Effect file overrides our standard material completely and lets users render in any way that they want.

As a second situation, let's assume that a user wants to use our standard material, but he wants parallax occlusion mapping instead of the default parallax mapping with offset limiting that our standard material uses. Again, Gamebryo is designed for flexibility. Our standard material is fragment-based, meaning that a programmer would not need to write a complete shader-just the small fragment that actually performs the parallax occlusion mapping. Users can extend the material with additional fragments or by replacing fragments. A programmer would simply need to set up the fragment using a simple XML file and write a small amount of code to extend the standard material. The system would use this new fragment to construct the necessary pixel and vertex shader.

We use the same approach on the consoles as well. Obviously, we have caching mechanisms in place to avoid runtime creation and compilation of shaders. The shader code for fragments tends to be identical on all platforms. In general, the differences between Cg and D3D HLSL are minimal. As an example, here's a fragment from our system that just computes the world position. As you can see, it's flagged for all platforms and languages.