Edit

Physically-based Materials

Ultra Engine employs physically-based rendering (PBR) to achieve next-generation visual quality with realistic lighting. PBR combines various material and environmental settings to create realistic surface appearances.

Embedded Model Materials

Model materials in Ultra Engine are embedded in the model file, and can be modified in the asset window. Standalone material files are only needed for brushes, terrain, and sprites.

Creating Materials

PBR materials are a complex blend of data layers compacted into different color channels and stored in various pixel formats. The easiest way to create PBR materials is by leveraging the editor's ability to automatically generate materials from textures.

To get started, you can obtain free PBR images from websites like ambientCG and Polyhaven. In this example, we will use a texture set featuring a rusted metallic surface.

  1. Download the texture pack and extract its contents into your Ultra Engine project. The extracted images will look like this:

    Texture Pack

  2. In the Ultra Engine editor, navigate to this folder in the asset browser. Right-click on the file MetalPlates013_1K-PNG_Color.png, select the Generate Material menu item, and wait for the editor to identify the different image files, combine channels, and compress the images into optimized texture files.

    Material Generation

  3. Open the resulting material file to observe how the textures have been combined, creating a surface with appealing variations in reflectivity and appearance. You can now delete the original PNG files if you wish, since they are no longer needed.

    Generated Material

The material generation algorithm performs the following steps:

The table below shows the optimal layout for material texture data:

Index Name Format R G B A
0 base BC7 base red base green base blue base alpha
1 normal BC5 nx ny -- --
2, 5 occlusion / roughness / metallic BC7 ambient occlusion roughness metalness --
3 displacement R8 height -- -- --
4 emission BC7 emission red emission green emission blue --
5 occlusion (alone) BC4 ambient occlusion -- -- --

While manually adjusting these settings would be very time-consuming, the built-in material generation tool can create optimized materials from raw images in seconds. You can modify the suffixes used by the material generation feature in the program options, specifically in the Material Generation settings.

Material Generation Settings

Material Settings

The most crucial settings for PBR materials are roughness and metalness.

Roughness

The roughness setting indicates the microsurface roughness of a material. When a metal/roughness map is present, the roughness setting acts as a multiplier, usually set to 1.0 (100%). If there's no metallic roughness map, this setting alone controls the surface's roughness.

Metalness

The metalness setting reflects the metallic properties of a material. Like roughness, when a metal/roughness map is present, the metalness setting acts as a multiplier, typically set to 1.0 (100%). If there's no metallic roughness map, this setting alone determines the material's metallic appearance.

It's important to note that the more metallic a surface is, the more it relies on the surrounding environment for reflections. A completely metallic material without environment maps will appear black.

In practice, most basic materials without metal/roughness maps will use 100% roughness and 0% metalness.

PBR Lighting

Ultra Engine achieves direct lighting through point, spot, directional, and box lights, each utilizing a different lighting equation to simulate light sources with texture-based shadows (shadow maps). Highly metallic objects are less affected by direct lighting because of their high reflectivity, primarily reflecting the environment.

Indirect lighting is accomplished with a combination of world environment textures and local environment probes. Since PBR materials accurately reflect their surroundings, having high-quality reflection data is essential.

Reflections play a significant role in physically-based materials. Without diffuse and specular environment maps set for the world, materials may appear dark.

No Reflection

When you add diffuse and specular reflection maps to the world, the scene becomes more vibrant but the lighting lacks depth because only the sky color is reflected.

Reflection Added

To achieve the best results, combine diffuse and specular reflection maps for the world with environment probes for indoor spaces.

Best Results

Optimal reflection data results in stunning and realistic visuals for your games.

Copyright © 2024 Ultra Software.
All rights reserved.