Hello developers,
Last December, we announced our first step towards the next generation of materials in Roblox with the first beta of UGC Materials.
Material Service lets you create custom MaterialVariants to use with parts and terrain so that you can bring your own custom looks to the platform. We’ve been amazed at the response and how you’ve taken advantage of the system to create truly amazing experiences!
We’ve been listening to your feedback, and today we’re excited to release a significantly improved beta. In Beta 1, we allowed you to override the visual properties of existing materials. In Beta 2, we want you to make as many MaterialVariants as you want, apply them to specific parts or as overrides to built-in materials, and share them. We’re introducing five key new features to enable this expanded use:
-
Per-Part Custom Materials: Create now entirely new MaterialVariants that can be assigned to individual parts rather than only overriding the material for all parts.
-
Adaptive Materials: Models with per-part materials automatically adopt the custom materials from any place you insert the models into.
-
Unified Material Overrides for Part and Terrain: We’re simplifying our material system by allowing a single material to apply to both part and terrain overrides.
-
UGC Terrain Coloring: UGC terrain materials respect color tinting.
-
Ability to customize the look of all-terrain sides: The new TerrainDetail object lets you have different visuals for the sides and bottom of terrain instead of using the same visuals for all sides.
Let’s dive into detail.
Per-Part Custom Materials
In the first beta, we only allowed for “overrides.” For example, you could replace the built-in Brick material with a custom Brick, but every part using Brick would pick up your custom material. Now, in addition to overrides, you can specify a MaterialVariant per part. To do so:
-
Add the variant in MaterialService as usual
-
Set the Material of the part to the base material you want
-
Use the new MaterialVariant property to specify a specific variant for this part.
The screenshot below shows three parts each with its own brick variant.
Adaptive Materials
We are trying to make materials flexible and useful, and as part of developing MaterialService, a question occurred to us: as developers adopt UGC materials and their experiences have different art styles, especially with per-part materials, could we some way make the materials adapt so that when you reuse a model across different places, it automatically adapts the place’s art style?
We’ve come up with a simple and elegant solution that we’re excited for you to try. When you specify a MaterialVariant on a part, we store the name of the variant. This makes it so that if you move a model across places, it looks for an active variant with the same name and base material and automatically binds to it. This lets models instantly adapt to the art style of the destination place.
Let’s consider an example. Imagine you have MyAnimePlace and MyRealisticPlace. In each of these, you have a Brick variant called MyBrick, but they look different: one has an anime style and one looks realistic. In MyAnimePlace, you create a brick house using MyBrick and save it to Roblox. When you insert your house into MyRealisticPlace, it’ll see there is an active MyBrick variant and automatically use it, making the house adopt this specific art style.
If you want your models to look exactly as intended, you will need to include the variant when sharing the model and copy the variant into MaterialService in the destination place. We will be adding an option when publishing models to simplify this process.
As an added feature of the work we had to do to enable Adaptive Materials, when you want to set a variant as an override, rather than having to explicitly specify it, you can simply name the variant the same as the built-in material you want to override (e.g., “Brick”) and by default, MaterialService will use it as an override.
API Changes to Support Per-Part and Adaptive Materials
To support these new features, we needed to change the MaterialService API. The prior API calls will be removed shortly. Here is the new API:
-
MaterialService:SetBaseMaterialOverride(Enum.Material, string)
. This function sets an override with a specified MaterialVariant name. -
MaterialService:GetBaseMaterialOverride(Enum.Material)
. This function returns the current override MaterialVariant name for specified Material type. -
MaterialService:GetMaterialVariant(Enum.Material, string)
. This function returns a MaterialVariant object reference under MaterialService that has a matching BaseMaterial and Name. If more than one matching MaterialVariant exists, it returns a random result from the matches.
Unified Material Overrides for Part and Terrain
We heard your voices about wanting to create materials that are consistent between parts and terrain. In order to streamline the authoring process and solidify the concept of unified material, we combine the part and terrain overrides into one section: Material Overrides.
IMPORTANT: Because of this unification, any currently-set overrides will be lost. You have to set the overrides again.
UGC Terrain Coloring
We are happy to announce that Terrain MaterialColors are now applied to UGC Terrain. In addition, UGC terrain uses tint coloring–just like parts–instead of hue shifting. This allows you to create more consistent materials between parts and terrain. Soon, when we release an upgraded set of built-in materials, these will also use tinting, fully unifying material coloring.
Terrain Detail for Side Customization
We heard your feedback that you wanted more control over custom terrain materials, specifically that you wanted ways to set different visuals for each side (including top and bottom) rather than reusing one visual for all sides. TerrainDetail is the answer. Simply create a TerrainDetail object under the desired MaterialVariant, upload your textures, and specify which face it affects.
What’s Next?
While this is a major set of updates, there are still three major things yet to come:
Built-in Material Upgrade
We are soon releasing a switch on MaterialService that will let you opt-in to new, 2022 materials. These upgraded materials not only look great but are designed to more seamlessly work with UGC materials. They also introduce textures currently only available to the terrain as part textures.
Material Manager
While we are taking steps to make the current material workflow using Explorer and Properties smooth, we think the best way to manage materials is with a user-friendly, visual interface. We’ve been working on a new tool we call Material Manager that we’ll be sharing with you as a beta soon.
Material Library Expansion
After we have UGC materials fully released and have upgraded the built-in materials, we will start releasing new base materials. This will provide you with more precise materials to use when building, allowing for more flexibility and more accurate emergent behavior.
Finally, the question many of you are asking: when can you use this with shipped experiences?
We keep features in beta so that we can react to your feedback without fear of breaking live experiences, as sometimes addressing your feedback requires major changes. For example, to support per-part material variants, we had to overhaul a lot of the internals of MaterialService! Our goal is to fully ship MaterialService “soon,” but we want to hear what you think and determine how to address any feedback before we begin discussing timing.
Thanks to @fnublox, @programeow, @Homeomorph, @4thchamber, @ProtoValence, @TravelerUniverse, and @c0de517e for their continued hard work on UGC Materials!