Skip to main content
Skip table of contents

Creating, editing, and applying custom materials

This article will guide you through a workflow for creating a custom material, editing its parameters, and then applying it to a model within OKO Unreal Engine Editor Extensions (OKO UEEE).

The Custom Materials feature allows users with Creator permissions to replace the base textures of any model in OKO with ones they have defined themselves. 

Custom materials in OKO UEEE are only available in Creator Mode.

Prerequisites

You will require an Unreal Engine project with the OKO plugin. 

Additionally, ensure the base materials table is set in your project settings. You can follow this guide for help. Please note that this must be configured separately for each project you add the OKO plugin to.

Instructions

Creating a material

Open the Asset Library whilst in a space. This can be done in Unreal by going to Windows -> OKO -> Home. 

Right-click anywhere within the Asset Library panel and select ‘Create Material’.

Alternatively, you can click the plus icon in the top right corner of the Asset Library panel and select ‘Create Material’.

This will now create a new default material in your space.

Editing a material

Right-click on the material you want to edit and select ‘Edit Material’ to open the edit material window. Alternatively, you can double-click a material to instantly open it.

The edit material window contains a list of the material’s current values and allows you to modify them. It’s divided into two subsections: 

  1. Material Properties – the basic properties of the material.

  2. Textures – the specific textures applied to the material.

Modifying any of these properties will enable the Update button. This allows you to commit the changes and update the material in OKO for all users in the space.

Using textures

You can assign an image or a video to the texture slots in textures. The image assets must be present in the space’s Asset Library, but do not need to be applied to another component in the space. To use a video as a texture, it must first be present in the space on a separate video component.

Selecting the drop-down option next to each texture will show a list of selectable valid textures.

Image textures will display only their name, while video textures will show the space entity and video component they’re applied to, formatted as ‘SpaceEntityName/ComponentName’.

Using an image texture

To upload an image asset to the space, right-click anywhere in the Asset Library panel or click the plus sign in the top-right corner, then choose ‘Upload Asset’. This will open a new file browser window where you can select a file from your local computer to upload to OKO.

By default, the browser searches for OKO-compatible files. For images, this includes PNG and JPG formats. Simply select the image you wish to use as a texture and click ‘Open’.

The Asset Library will refresh on a successful upload, and you should see your new image asset there.

And it will now be selectable as an image texture on a material.

Using a video texture

To upload a video asset to the space, right-click anywhere in the Asset Library panel or click the plus sign in the top-right corner and select ‘Upload Asset’. This will open a new file browser window where you can select a file from your local computer to upload to OKO.

By default, the browser searches for OKO-compatible files. For videos, this includes MP3 and MP4 formats. Simply select the video you wish to use as a texture, then click ‘Open’.

The Asset Library will refresh on a successful upload, and you should see your new video asset there.

Drag the video asset into the Unreal Editor viewport to add it to the space as a video component.

This will automatically create a space entity actor and a video component with the corresponding video asset.

To use it as a video texture, you will need to set the video component’s playback state to Play. It’s also recommended to enable ‘Is Auto Play’, ‘Is Loop Playback’, ‘Is Auto Resize’, and ‘Is State Shared’.

Your video component should now be selectable as a texture source in any material in the space.

You only need one instance of a video component in a space to use it as a video texture on as many materials as you want. You don’t need to make a new video component for each material, you can assign the same video component to multiple materials.

Deleting a material

Right-click on a material in the Asset Library panel and select ‘Delete’.

Applying a material

Create a static or animated model component in your space.

To upload a model asset to the space, right-click anywhere in the Asset Library panel or click the plus sign in the top-right corner and select ‘Upload Asset’. This will open a new file browser window where you can select a file from your local computer to upload to OKO.

By default, the browser searches for OKO-compatible files. For models, this includes only GLBs. Select the model you wish to use and click ‘Open’.

The Asset Library will refresh on a successful upload, and you should see your new model asset there.

Drag the model asset into the Unreal Editor viewport to add it to the space as a model component.

This will create a space entity actor and associated model component of the appropriate type.

To apply a custom material, select the ‘Model Component' and expand the Material Overrides section. This will show a list of submeshes that can accept a material override. In this case, our GLB contains only one mesh that can have a material applied to it.

Then, drag the custom material asset onto the Material Override slot. This will automatically apply it to the Model Component.

To remove a material override and reset the texture back to the model’s original one, click the Undo arrow next to the Material Override.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.