Chapter 23 | PBR Materials


PBR Material Editing and Texture Mapping

The material properties of any polygon mesh object can now be adjusted via the “material” menu in the left-side control panel. To demonstrate how to add new materials to an object, let's begin with a vehicle selected from the Virtual CRASH assets browser. We start by selecting the polygon faces that utilize the “carpaint” material within the “material” menu. If materials are already present in the menu, you can simply left-click on any of them to make a selection. It's important to note that not all vehicles come with pre-defined materials in this menu.

With these polygons selected, we can left-click “new” underneath the material list to assign a new default material to those polygons which were selected.

With the new material selected, scroll down beneath the list, and you’ll find the Physically Based Rendering (PBR) material settings.

PBR materials utilize parameters based on the physics of light and materials to ensure consistency and realism across various lighting environments. PBR materials typically include several attributes necessary in the material interface:

  • Albedo: Defines the surface's color in neutral lighting, without the influence of direct light or shadows.

  • Normal: Adds surface detail and texture without altering the object's geometry, simulating small bumps and grooves.

  • Metalness: Determines whether a surface behaves like a metal or a non-metal. Metals reflect all incoming light as specular reflections, while non-metals diffuse part of it.

  • Roughness: Controls how rough or smooth a surface appears, affecting the sharpness of reflections. A smoother surface results in clearer reflections, whereas a rougher surface scatters light, leading to diffuse reflections.

  • Emissive: Emissive materials emit light as if they are light sources themselves (note: they do not produce actual illumination in the scene as of the initial release of VC6), independent of external light sources. This property is useful for creating objects that appear to glow, such as screens, light bulbs, or other visual effects. The emissive property can define both the color and the intensity of the perceived light emitted by the material. When using this property, you will typically want to enable the bloom effect as well (see Chapter 2). See example below of how to apply this effect.

  • Opacity: Determines how transparent a material is. A material with 100% opacity is fully opaque, meaning no light passes through it, while a material with lower opacity levels will be partially or fully transparent, allowing light to pass through and making objects behind it visible.

Below we see the PBR default settings.

Below, we've increased the metalness and decreased the roughness to achieve a mirror-like finish. Experiment with the various sliders to gain a deeper understanding of how these adjustments influence the material's appearance. Remember, if you're in “Object” [Shift+O] selection mode, left-clicking “new” will create a new material for all polygons in the object’s mesh. Typically, you would want to be either in “Faces” [Shift+F] or “Elements” [Shift+E] mode to apply new materials to specific components of the vehicle.


Automatic Material creation by Mtl File

Polygon mesh objects, such as vehicles, can be imported into Virtual CRASH in obj, 3ds, and dxf formats. If the obj file has an associated mtl file sitting in the same file folder, the Virtual CRASH will parse the material specifications in the mtl file and automatically create materials. These materials can then be further customized in the material menu.

Here for example, we see a few entries from an mtl file used to define the materials for a vehicle model such as the one used above.

Automatic Texture Mapping by mtl File

A texture map assigns a color pattern via image file to the local 2D coordinate “(u,v)” space of the mesh object. As with mtl files described above, many 3D model builders also include texture map files along with the geometry. The mtl file tells Virtual CRASH which portions of the various image files are to be mapped onto a set of materials. Here we see an example mtl file, which references various jpg image files which contain the model’s texture mapping.

The texture map image files sit in the same file folder as the mtl. Note, it is typical to find the paths to the image files contained in the mtl file need to be modified to point to the image file location on your local hard drive. The easiest way to ensure the image files are found is to place the images, mtl, and obj file in the same file folder. Then simply remove the full path altogether as shown above.

Here, we see the model imported into Virtual CRASH. Note that any logo or pattern can be added by simply modifying the image files used for texture mapping. For components in the material list with a texture map applied, you will see an “x” symbol next to “albedo”, indicating that the colorization is derived from the image file. This feature can be disabled by left-clicking on the “x”. Furthermore, left-clicking on “albedo” allows you to upload an alternative texture file.

Creating your own texture map can be occasionally difficult since knowing how a texture will map to an object’s surface geometry is difficult to know. One way to better understand how an image will be mapped to a geometry is to use a pattern image file such as the one below.

Here we see the image mapped onto various shapes.

Image placement, orientation, and scale can be modified using the (u,v,w) scale, (u,v,w) offset, and the angle controls.

The “map method” option gives more control over how the texture map is to be placed on the surface geometry. By default, “object” is used, which wraps the image over the entire surface geometry using the (u,v) local space of the object. If “local xy” is selected, the image is projected downward along the object’s local z-axis (similar to the receive projection option). Note, the boarder pixels are stretched downward along the z-axis in the example below. Since the local option is used below, the mapping will not change as the objects move through the scene. If “world xy” is used, the image is projected downward along the global z-axis. In this case, the texture would be seen as static relative to the environment even as the object moves. Often it is easiest to use “local cube” map method.

 

Logos and Decals

Suppose we wish to place a logo on our truck shown below; however, our truck did not come with any pre-made texture map image files we can use as a template. Here we will demonstrate two methods to place our logo.

Logo embedded within texture map image

We begin by using the lasso tool [F6] to select the polygon faces [Shift+F] where we wish to apply a logo. Remember, you can expand your selection by using ctrl+lasso and reduce it by using alt+lasso. To conclude the lasso command, right-click. Once we've selected our faces, we create a new material and apply our pattern image file as albedo, similar to previous steps. When the map method is set to “object”, the truck's u-v geometry results in a complex mapping. Often, opting for one of the projective views simplifies the process.

Switching to the “local xz” map method significantly simplifies the material mapping process for this scenario. It's important to note that because the projection occurs along the local y-axis direction, the image initially appears inverted. Setting the u size to -1 rectifies this issue, allowing us to accurately gauge the placement of various portions of the truck’s geometry in relation to this texture map.

If necessary, in an application like Photoshop, you can overlay your logo onto the checker pattern to visualize the logo's placement in relation to the vehicle's geometry. Fortunately, in this instance, the mapping process is straightforward due to our use of the local xz projection mode. Next, we proceed to load our logo by clicking the “albedo texture” button.

We next create a new texture map (right) with the same pixel length and width as our test image (left). We place our logo centered in the image, with the background color set to the same value as our diffuse color. To ensure uniform color on the rest of the vehicle, we sample a small corner of our logo graphic and apply it as albedo to the remainder of the vehicle polygons. We then copy and paste the other PBR parameters to ensure they are the same as those for the main body.

 

PBR Materials Library

In the assets browser, you’ll notice a tab for “materials”. Open this section to reveal the 300+ PBR material library. In the example below, an extrusion has been made to model a wall in our crash scene. After ensuring the extrusion is not frozen, we can scroll through the material library to find a suitable material to apply. In building surfaces > masonry, we find some brick wall textures. Simply hold+left-click on the material you would like to apply, then drag onto your object and release. You’ll then be prompted “Do you want to replace current material?” Press “Yes”.

Select the new material from the object’s material list and fine-tune the mapping and (u,v,w) size, offset, and orientation as needed. Note, here because we converted the extrusion to a mesh via tools > convert > to mesh, we can drag and drop different materials on to different elements of the wall (the side “coat” and top “cap”).

If you drag and drop another material from the assets browser, it will be added to the material list and be applied to the element under the mouse cursor. If you wish to set the whole object to that material, simply select the object, select the material in the list, and left-click “set”.

 

Example of Drag and Drop Materials and Manual Material Property Assignment on Vehicles | Example of Enabling Emissive Lighting

In the next two videos below, we demonstrate the drag and drop functionality to enable emissive lighting (with bloom enabled) on vehicle components.

This drag and drop functionality works on all types of objects in Virtual CRASH: vehicles, CAD elements, extrusions, and multibodies!

 

Drag and drop materials on multibody elements

Below, we examine the drag and drop workflow on the multibody objects. First, we switch to Elements [Shift+E]. Next, we lasso all the elements of our new multibody. Then drag and drop a skin texture on the multibody.

Next, we left-click on different elements of the multibody to apply textile materials to the upper and lower body.

Apply the same process to the classic multibody to fine-tune his clothing as needed.

This workflow is further illustrated in the following video.

 

Importing 3rd party pbr materials

Typically, PBR materials acquired from third-party sources will include the necessary texture files (albedo, normal, metalness, roughness, and opacity). To assign these textures, simply left-click the corresponding button and locate the texture file for each PBR channel.

mixing

The “mix” toggles offer enhanced control, allowing you to use scale sliders to fine-tune the appearance of each channel. In the example below, we overlay a filled polyline on our road surface as seen in the orthomosaic imagery data. Next, we apply a wet road material to the filled polyline, but we activate “use albedo alpha” and “mix albedo color-texture”. This adjustment enables the use of the transparency slider in the “albedo color” drop-down menu to make the material’s albedo channel transparent, effectively utilizing only the other material channels. However, setting the normal channel to 100% results in an overly pronounced appearance of damage and wetness.

Adjusting the normal intensity slider downward enables us to leverage the material’s properties while affording us precise control over the road surface's final appearance.

This process is illustrated in the video below.

Note that materials can be superimposed and combined. For instance, two filled polylines with distinct materials can be overlaid, creating complex and unique material blends.

Experimenting with these various channel settings is crucial to fully understand their impact on surface appearance.

Exporting materials

Each material listed in the materials section can be exported using the “export” button. This action generates a proprietary .vcl material file, which can be conveniently reused in future projects by dragging and dropping it from the Windows File Explorer. To have Virtual CRASH generate a thumbnail preview of the material, ensure to enable the “export image” option.

Copy/Paste Functionality

You can copy materials from the material list of one object and paste into the material list of another object. This is demonstrated below.

 

Exporting albedo via copy

Materials feature both “copy albedo texture” and “paste albedo texture” buttons, enabling users to copy albedo images directly to the Windows clipboard. These images can then be pasted into any image editing software for modifications. After editing, the updated image can easily be pasted back into the material using the “paste albedo texture” button. This workflow is illustrated below.



© 2024 Virtual CRASH, LLC. All Rights Reserved