If you are unable to find a colorized material or colorization function within ASA that suits the needs of your asset, it is also possible to create you own colorized materials using ASA’s colorization functions or even create your own colorization function. This guide will go over the primarily used colorization functions in ASA, how to add them to your material, and how to create a simplified version of a colorization function that you can build off.
There are a couple different functions that ASA materials use for colorization. The main two are “Content/PrimalEarth/CoreMaterials/Functions/Colorization/Ark-Colorization_6Channel_VT.uasset” and “Content/PrimalEarth/CoreMaterials/Functions/Colorization/Ark-Colorization_6Channel_VT_PRIMDATA.uasset”. They both work similarly in that they separate out the regions from the colorization map and apply the specified color to the region. The main difference is that the Primdata version of the function uses a collection of primitive data parameters that are updated at runtime. This is to remove the need to create dynamic material instances for colorization. Primitive data is primarily used in structure and equipment materials. When creating a material that needs to support colorization it is recommended using one of these colorization functions. Colorization is most often done early in the material after the initial definition of the base color, so that colorization can be applied before any further modification and the material visually can be tweaked with colorization in mind.
The primdata version of the colorization function in use in the “MM_equipment” master material.
To add the colorization function to a new material add a material function node. Set the function call to one of the colorization functions that best fits your use case, and plug-in your material attribute at the point in which you want your material to be colorized. As mentioned above, it is recommended to do this early in the material so that further adjustments can be made accounting for colorization
Material Function Call Node before applying a material function.
Material Function Call Node after applying one of the colorization material function.
Colorization material function connected to the base material attributes and to a static switch parameter.
Most colorizable ASA materials make use of a static switch parameter often named “IsColorized?” to be able to enable and disable colorization functionality in the material instance. However, if your material is always intended to be colorized you may skip this step. That is all that is needed to add the colorization function to your material, from there you can continue to create your material.
⚠️ It is advisable to keep all static switch parameter adjustments to higher level material instance parents to avoid creating unnecessary material permutations that get complied separately. For example create a default and colorized “master” instance parent of your material then create child material instances of the “master” instance parent to be used by your asset.
As stated above there are multiple colorization functions used in ASA and there are materials that make use of their own custom colorization logic. While it it advised that you make use of one of the available colorization functions already in ASA this section will provide an overview of creating your own colorization logic. This overview will provide a greater understanding of how the colorization functions work and the basic knowledge needed to create your own colorization logic.
This overview will be done inside a material function but you can create the same colorization logic directly inside a master material with little adjustment.
The first step of creating colorization is to separate out the regions from the colorization mask, to do this we will first need a colorization mask. To get one will we will need to make a texture param2D and name it “ColorizationMask”, then populate our texture parameter with a colorization mask. You can pick one that you have generated yourself or one of the many available in ASA, just be sure to pick one with all six color regions to better visualize that your colorization logic is working for all six of the color regions. Used below is the Tek Spear colorization mask “Content/LostColony/Weapons/TekSpear/T_TekSpear_Colorized_M.uasset”.
In-editor example of our texture parameter 2D with the texture parameter set with a colorization mask utilizing all six regions.
⚠️ Ensuring that you use the exact names of parameters as mentioned and seen in this overview will be incredibly important as these are the parameters that are expected by ASA’s systems, otherwise your colorization logic will not correctly function in-game.
Next we will break out just the red region from the colorization mask, we eventually will repeat this process for all 6 regions, but for now we will focus on the red region. To break out the red region we will use a “BreakOutFloat3Components” node then add the blue and green component together before subtracting them from the red effectively removing anything that was not solely in the red channel from this texture. We will then clamp the output 0-1. As you can see in the image below we now have a mask of just the red region separated out from the colorization mask.
In-editor example of breaking out the RGB components of the colorization texture and then subtracting the G & B components to result in a mask of our red region.
This next step is quite simple, we will be creating a vector 3 parameter and naming it “Color0” as this will be the parameter that defines the color of our first region. This is an opportunity for customization if you want to adjust how much color is applied to the first region, it’s level of saturation, etc. For this overview we’ll be keeping it very simple and just multiply our vector parameter with red region mask, effectively colorizing our first region.
In-editor example of multiplying our separated out red region with our “Color0” parameter.
Next we will do the same step for the green and blue regions and then combine the colorized masks. For the green region mask you will need to subtract R&B from G and for the blue region mask you will need to subtract R&G from B. Then add the three outputs together resulting in a mask combining the first three regions as shown below.
In-editor example of separating out the green and blue regions and then multiplying them by the second “Color1” and third “Color2” color parameters before adding them together to create a combined RGB colorized mask.
As you can see in the image below we have basically reassembled the RGB regions of our colorization mask, but now we can control the color assigned to each region. Next we will do the same with the CMY regions which requires slightly different logic to separate out.
The Tek spear colorization mask imposed over our combined RGB colorization mask.
Next we will separate out the yellow region. The key difference between separating out the yellow region compared to the RGB region is we will take the R and G channel and “Min” them, then we component mask the output to just the R channel resulting in our yellow region.
In-editor example of separating out the yellow region by doing a “Min” operation on the R and G channels of the colorization mask and multiplying the output with our “Color3” parameter to create our colorized yellow region mask.
⚠️ If you have taken a look at some of ASA’s colorization functions, you may have noticed a static switch parameter named “LegacyMode” that switches the Cyan and Yellow Regions. There are several permutations of the colorization function with their own intricacies. It’s advised to know which colorization function/material you are developing your colorization mask for so your colorization regions end up in the order you anticipate. For this overview we will be skipping the “LegacyMode” parameter and instead split the regions to match the initial intended regions depicted in the Tek Spear colorization mask.
In-editor example of the ASA colorization function “Ark-Colorization_6Channel_VT” using the “LegacyMode” static switch parameter.
Now we can do the same for the cyan and magenta region performing the “Min” operation on the G&B channels for the cyan region, and on the R&B channels for the magenta regions. After we have a mask for both the cyan and magenta regions we can add the three masks together like we did with our RGB regions to create a CMY colorization mask from our separated out regions.
In-editor example of separating out the cyan and magenta regions and then multiplying them by the fifth “Color4” and sixth “Color5” color parameters before adding them together to create a combined CMY colorized mask.
So now that we have our separated out color regions recombined into RGB and CMY colorization masks, we can add them together to recreate our full colorization mask, the colors of which are now driven by our “Color0” - “Color5” vector 3 parameters.
In-editor example of the combined final colorization.
All that is left to complete our simple colorization function is adding an input for our base color texture and an output to the function. Simply multiply the final colorization mask with the base color input and connect the resulting output to the material function output to complete your colorization function.
In-editor example of our combined final colorization multiplied with our base color input and the resulting output connected to the material function output.
Now that we have our completed simple colorization function we can test it by creating a test material and plugging our desaturated colorization diffuse texture into the base color input of our colorization function. As you can see in the preview in the image below our colorization function is multiplying the default colorization with our Tek Spear base color.
In-editor example of our test material with the Tek Spear desaturated colorization diffuse texture used as the input for our simple colorization function.
We can then create a material instance of our test material to see that we have vector 3 color parameters for each of the colorization regions and that we can then set them to define our default colors for the asset. As well as parameters to change out our colorization mask and desaturated diffuse textures so that you can use your new colorization material for any of your assets.
In-editor example of a material instance created from our test colorization material showing the colorization parameters that we can set to define the default colors of our asset.
In-editor example of different colors applied to the Tek Spear via our test colorization material instance.
You now have a better overview and understanding of the colorization functions and logic used within ASA. Remember, it is advised that you thoroughly examine and explore other colorized materials and colorization functions within ASA to see if any suit your needs, before deciding to make a custom colorization function and material. Primarily for ease of use but also to make your asset more performant.