Build version are a way to toggle different parts of an effect simulation graph on or off based on which target platform it is exported for.
For example, when exporting the effect for mobile platforms such as android or iOS, you might want to disable a more expensive computation. But still be willing to include it on PC/desktop builds. You can also simply change some LOD metrics depending on the target platform.
Whenever baking for a specific target platform, you can specify a list of build version tags to the asset-baker. The graph compiler will then filter the relevant parts of your effect for that specific combination of tags.
Version tags can be tested in a simulation nodegraph using the version node, or inside a script by using the version keyword (which acts as an if/else statement).
Standard version tags
As of v2.3, there is no standardized list of version tags. It is up to the game-engine integration and to your project to define version tags.
This is something we expect to change in v2.4 or v2.5, where you should be able to always use some predefined version tags.
This page will list the standard build versions. We expect them to include things such as “mobile”, “android”, “ios”, “ps4”, “desktop”, “macos”, “windows”, etc…
You will be guaranteed that they will work in the UE4, Unity, and Lumberyard plugins, as well as any compliant integration into an in-house engine.
Using build versions
In the nodal editor, you can drop a “static version switch” node, which will perform a compile-time ‘if’ and select one of two input values based on the build version.
Add all the build tags you want to the “Versions” property of the version-switch node. If the current build versions contains any of those tags, the node will output the value of its first input. If none match, it will output the value of its second input.
Here is an example where two version nodes are used to pick the render position between two different physics nodes: one with a turbulence, and one without a turbulence (cheaper)
The second node just picks two different colors to help visualize the change better. Note that the version tags are different as an example, but they essentially map to the same condition: the expensive version will be picked on desktop (windows/mac/linux) and consoles (ps4/xboxone), and the cheap version will be picked in any other case (mobile: android/ios). See the “Setting up project settings” section below to see the setup used.
Note that we could also have used version switch nodes that test the “mobile” version tag instead, and swapped the inputs.
The preference between one or the other is usually decided on what you want to specialize for compared to the “base” version.
If you want to specialize a cheaper version for mobiles: it makes more sense to check explicitly for mobile. Consequently, everything else uses the “base” version with the turbulence.
Likewise, if you want to specialize a higher-quality version for higher-end targets: it makes more sense to check explicitly for those targets. Consequently, everything else uses the “base” version without the turbulence.
Note: In the upcoming v2.4, the inputs of the version nodes will be reversed so the node acts as a “specialization” node. Therefore, the base version will map to the first input.
By default the node will output the first input. If the version test succeeds, the node will output the second input.
You can also perform version checks inside scripts, using the
Previewing build versions
Setting up project settings
The editor allows you to specify a set of preview build versions in the project settings. They allow you to quickly test what your effects look like under different build version settings. You can specify a list of tags for each build version:
Note that the build versions are currently only an in-editor preview helper, and are not automatically taken into account during baking, so they do not need to match the actual bake platforms specified in “Platform settings list”.
Each version starts with the name of the build version. In the above example, we have 3 build versions: “Phone”, “PC”, and “Console”.
The version name is followed by a colon and the list of comma-separated version tags. In the above example, the “PC” version defines the tags “desktop”, “windows”, “linux”, and “macos”.
Build version tags are case-insensitive.
Preview in the effect editor
You can preview build-versions using the build version dropdown in the effect editor’s viewport toolbar. (the UI might change in the future)
|Default: no active build version||Choosing a preview build version||Active build version: “Console”|
Alternatively, you can also type the build version directly in the scene interface panel:
Whenever you change the build version, the effect editor will recompile and restart the entire effect.