Clear
Back

Using Textures

A texture is an image file used to help define the appearance of an object in your scene.

You can apply one or more textures to a material, then apply the material to an object.

Spark AR Studio supports PNG and JPG texture files. Files can be a maximum of 1024x1024 pixels in size.

Learn about:

Adding textures

To add a texture to your project:

  1. Click Add Asset in the Assets panel.
  2. Select Import from Computer.

You can also add textures directly to materials without adding them to your project first:

  1. Select the material in the Assets panel.
  2. Click the dropdown next to Texture in the Inspector.
  3. Select New Image Texture.

Applying textures to materials

To apply a texture to a material:

  1. Select the material in the Assets panel.
  2. Select a dropdown next to Texture in the Inspector.
  3. Select the texture you want to apply.

Where in the Inspector you'll apply the texture depends on the material you're creating and the type of texture you're applying.

For example, if you're creating a standard material you'd apply a base texture, defining colors and details on your object, under Diffuse. You'd apply a normal map, to give the impression of bumps and grooves, under Normal.

You can also use visual shaders to apply textures to materials in the Patch Editor.

Textures you can make in Spark AR Studio

You can make a variety of textures in Spark AR Studio, without importing custom textures to your project. For example, you can:

  1. Turn the video captured by the camera or the face tracker into a texture.
  2. Use the segmentation texture to separate the user from their background - and transform the environment behind them.
  3. Use visual shaders to create color gradients, and signed distance fields to create shapes and patterns.

Compressing textures

Compressing textures can make your effects perform better. It's a good idea to look for opportunities to compress textures in your effects where you can. Find out more about texture compression.

Using filtering to correct errors in textures

When a texture is selected in the Assets panel, you can use the Filtering options under Sampling to address size mismatch between the actual image data and its footprint on the screen as it's rendered.

Filtering can help correct errors in textures, particularly in scenes where part of a detailed texture is placed further away from the viewer.

The higher the filtering, the greater the impact on the performance of your effect.

There are 4 options to choose from:

  • None will apply nearest neighbor interpolation. This will usually result in pixelated textures.
  • Low will apply Bilinear interpolation.
  • Medium (MIP) will use Mipmapping to apply a medium level of filtering. You may still see abrupt changes in quality, the further the texture is from the camera.
  • High (Trilinear) will apply the highest level of filtering. Abrupt changes you might see when using Medium filtering shouldn't be noticeable anymore.

Below we've applied a texture that looks like a grid to a plane. The plane is tilted away from the camera.


The image on left shows how this texture would look on the device with Low sampling. In the middle we've selected Medium and the final image has High sampling:

Textures - Properties

When you select a texture in the Assets panel you'll see its properties in the Inspector.

Which properties you'll be able to change will depend on the type of texture you're using.

File, File Size and Dimensions

The file, file size and dimensions of the texture.

Alpha Channel

Whether the texture has an alpha channel or not.

Premultiply

Check this box to integrate transparency information.

Color Encoding

Choose whether colors are interpreted as Linear or sRGB.

Sampling

Adjust Filtering to address size mismatch between the actual image data, and its footprint on the screen as it's rendered. Choose either:

  • None - to apply nearest neighbor interpolation. This will usually result in pixelated textures.
  • Low - to apply Bilinear interpolation.
  • Medium (MIP) - apply a medium level of filtering, using Mipmapping.
  • High (Trilinear) will apply the highest level of filtering.

Texture Sizes

Calculate the size of the texture across different devices.

Compression

Experiment with different compression settings.

Tiling mode

Use U Tiling mode to repeat, clamp or mirror image contents along its horizontal axis.

User V Tiling Mode to repeat, clamp or mirror image contents along its vertical axis.

Used By

Any materials using the texture.

Compression Preview

Preview compression on the texture.

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Join the Spark AR Creator's community

Find inspiration, see examples, get support, and share your work with a network of creators.

Join Community

Frequently asked questions

Have a specific question? Maybe it's been answered.


Read FAQs
Was this document helpful?