Using Textures and Materials

Textures and materials are the files and settings you use to define the surfaces of an object. Textures are the files that define the detail, texture and color of an effect, while materials are the settings that control how a texture is used. For example, a material might determine how reflective or opaque a texture is.

Textures

A texture is an image file that is used to help define the visual appearance of an object in an effect. One or more textures are combined into materials, and materials are applied to objects in the scene.

Image files may be a maximum of 1024x1024 pixels in size. In PVR and ETC compression schemes, exported images are resized to a square with edge length equal to the smallest power of 2 larger than the larger dimension of the texture. For example:

  • A texture of size 1024x1024 or 512x512 will remain unchanged.
  • A texture of size 512x400 will become 512x512.
  • A 400x400 texture will become 512x512. The image is scaled up, but the extra pixels don't add any extra detail. This could be an opportunity to either save space and scale the image down to 256x256 or to improve quality without adding to the export size, by scaling the original image up to 512x512.

For animated textures, consider using a sprite sheet that contains all of the frames of the animation.

Materials

A material defines the optical properties of the associated texture. A texture can appear opaque or reflective depending on the settings of the applied material. You can set the shader properties of a material to diffuse, reflect, or multiply the colors in a texture. You can also set the Blend mode, Cull mode and Opacity of a Material in the Render options.

Because the opacity of a material affects the underlying layers, if you're creating a face effect you should test your materials and textures on a variety of skin tones to ensure that you get the intended effect. AR Studio contains several videos so you can test how your effect works on different skin tones.

To change the video, click Video in the middle of the toolbar, then click on a skin tone.

Learn more about the textures and materials that come with AR Studio.

Improving Performance

The size of the textures you use influences the quality and performance of your effect. A high quality texture file gives your effect a lot of detail. However, a high quality file also slows the performance of your effect by using a lot of memory and increases download times for people using your effect.

To use high quality texture files while maintaining the performance of your effect, you can reduce the size of your texture files. To be sure you're using the smallest texture files, you can compress them when you export your effect prior to submission. You can also compress the texture files using the compression schemes in AR Studio. Learn how to compress textures in AR Studio.

We support following compression schemes:

Basic

Textures are exported without any compression. Using this option results in large memory use.

  • PNG/JPEG (Automatic): The default option which optimizes imported PNG or JPEG files to the smallest possible size using lossless recompression.
  • RGBA (Passthrough): Uses lossless recompression to optimize imported PNG or JPEG files to the smallest possible size.
  • RGBA (PNG): Uses lossless recompression via Zopfli to ensure small file sizes. When loaded into memory these textures will take 24 or 32 bits-per-pixel depending on the presence or absence of an alpha channel.
  • RGB (JPEG): Optimizes JPEG files using MozJPEG. When loaded into memory these textures will take 24 bits-per-pixel, no alpha channel.

ETC

Textures are compressed for use in Android devices. The following options are available for this compression scheme:

  • ETC2_RGB: 4 bits per pixel, no alpha channel
  • ETC2_RGBA: 8 bits per pixel, alpha channel
  • ETC2_RGB (Punch-through alpha): 4 bits per pixel, including a 1-bit alpha mask (therefore regions are either fully opaque or fully transparent)

PVR

Textures are compressed for use in iOS devices. The following options are available for this compression scheme:

  • PVRTC_V1_2_RGB: 2 bits per pixel, no alpha channel
  • PVRTC_V1_2_RGBA: 2 bits per pixel, with alpha channel
  • PVRTC_V1_4_RGB: 4 bits per pixel, no alpha channel
  • PVRTC_V1_4_RGBA: 4 bits per pixel, with alpha channel

In addition to selecting the compression scheme for all textures in an effect, you can override this general compression scheme by setting the compression scheme for each texture. Setting the compression scheme for a texture allows you to further compress or use less compression on that texture.

To compress all textures when exporting an effect:

  1. Click Export on the right side of the toolbar.
  2. Select the export option that you want to use. You can select all three options which will create three export files.
  3. To change the export settings, click Export Options.
  4. Click Export to create the export files.

To set the compression scheme for a texture:

  1. In the Navigator on the left side, select a texture.
  2. In the Inspector on the right side under Compression, select Override ETC or Override PVR, and then set the compression settings for that texture. When you export the project, AR Studio will use the settings in the Inspector to compress that texture instead of the Export settings.

This procedure overrides the export settings for all textures so that you can specify the compression scheme for that texture.

Testing

We recommend testing your compression settings on different skin tones in the Editor and on a variety of devices to ensure that you are making the best decision between quality and performance. To make sure your effect performs as expected, try and test on:

  • An iOS device
  • A high-end Android device, such as a Samsung Galaxy X7 or a Moto G5
  • A low-end Android device, such as a Samsung Galaxy J1 Mini Prime or an LG K5