UDN
Search public documentation:
AllegorithmicSubstance
中国翻译
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
한국어
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
UE3 Home > Materials & Textures > Allegorithmic Substance Integration
Allegorithmic Substance Integration
Substances in UDK
- Multi-output - One file can contain all the maps needed for one or more materials
- Resolution independent - scales dynamically up to 2048x2048
- Parametric and dynamic - modify the textures in the UDK editor or even in-game
- Can be used as multi-purpose filters using dynamic bitmap inputs
- Non-linear and non-destructive creation process
The Substance Ecosystem
References
- Don’t know what a substance is? Check out this page for a quick overview of the technology.
- Want to know more about Substance Designer? This is the place you are looking for.
- Want to learn fast? Video Tutorials are available over here.
- Don’t want to buy stuff? Substance Utilities is free.
File formats
There are two main file formats in the Substance ecosystem. The editable one, text based and easily put under source control, is the sbs file format. This format is used to save packages made in Substance Designer, it can contain multiple graph, each one with several output. External resources like SVGs and bitmaps can be embedded in the sbs file, it can be compared to a .PSD file. Before using substance files in the UDK, you have to publish it. The result of this process is a Substance archive, or sbsar file. This is the format supported in the UDK and other software where Substance is integrated. It is a compressed, binary file format and it is no longer editable. Note: It is possible to save the values of the inputs of a Substance as presets. Those files have the extension sbsprs, and can be used to save multiple variations of a single Substance. They are text based and very light. Presets can be imported or exported from Substance Graph Instances (see "Substance Graph Instances").Workflow
SBSAR Import
When importing a sbsar, two objects are created: a Substance Instance Factory and one Graph Instance for each Graph contained in the sbsar file. The Instance Factory can be used to create other Graph Instances. An Unreal Material can also be created for each Substance Graph Instance.- Create Material will create a material in a subgroup of the package where the Graph Instance is created. The substance's outputs will automatically be plugged in the right material slots.
- You can specify a destination for the Graph Instances of the Substance you are importing. In this case, both the Graph Instances and their outputs will be stored in the specified package.
Substance Graph Instances
Each graph contained in a sbsar can be instanced as many times as necessary, allowing to have different variations of a single substance. Those Graph Instances can be saved in different packages.Modifying parameters
Graph Instance Editor
To edit input values in the Graph Instance Editor, double click on the Graph Instance of your choice and you will have access to the dynamic parameters (including image inputs).- Outputs
- Image inputs
- Inputs
- Bake Outputs
During the game
- Kismet
- Matinee
Technical Information
Modifying Instances from Unreal Script
To modify inputs, use the Graph Instance objects (SubstanceAirGraphInstance class). The interface is the following:// retrieve the input list native final function array<string> GetInputNames(); // retrieve an input's type native final function SubstanceAirInputType GetInputType(const string InputName); // modify the input value of the specified input (by name) native final function bool SetInputInt(const string InputName, const array<int> Value); native final function bool SetInputFloat(const string InputName, const array<float> Value); // modify an image input, object must be a SubstanceAirImageInput or a SubstanceAirTexture2D native final function bool SetInputImg(const string InputName, Object Value); // get the input value of the specified input (by name) native final function array<int> GetInputInt(const string InputName); native final function array<float> GetInputFloat(const string InputName); native final function Object GetInputImg(const string InputName);
Specific INI values
- During the cooking step, it is possible to limit the number of mip-maps kept in the packages, allowing to save significant amount of space. It is possible to setup how many mips are kept in the BaseEngine.ini config file, under the Substance section, with the MipCountAfterCooking parameter:
[SubstanceAir] ; number of mipmaps to keep during cooking MipCountAfterCooking=7
- The CPU and memory budget attributed to the Substance Engine is setup in the BaseEngine.ini file, in the following section:
[SubstanceAir] (...) ; memory budget MemBudgetMb=256 ; allow use of every CPU core available for generation (will leave one free for the main thread) FreeCore=0
Free substance resources
- Substance Utilities allows you to transform your textures into simple dynamic substances.
- The Beneath Demo is a downloadable UDK project textured entirely using substances. Source are available over here (DISCLAIMER: a last minute bug slipped through QA, see this thread for more information !
- More than 60 substances are bundled with Autodesk Maya and 3dsMax (2012 and up).
- A free pack of 25 substances for UDK users.
- Free substance filters and generators for Wood floors, Brick Walls, Stone objects textures, or Metallic objects textures can be downloaded for free on Allegorithmic's website.