Version: 2023.1
Language : English
Marking textures as "Virtual Texturing Only"
Sparse Textures

Virtual Texturing error material

This feature is experimental and not ready for production use. The feature and documentation might be changed or removed in the future.

You can use Streaming Virtual Texturing (SVT) with shadersA program that runs on the GPU. More info
See in Glossary
you create in Shader Graph. To use SVT to stream one or more textures, you need to set up your material and Shader Graph correctly. To learn more, see Using Streaming Virtual Texturing in Shader Graph.

When a texture is not set up correctly, Unity can’t render the material. Instead, Unity renders a Virtual Texturing (VT) error texture with a purple and blue checkerboard pattern. This texture remains visible until you fix the validation error.

The Virtual Texturing error texture:

Virtual Texturing Error Material
Virtual Texturing Error Material

Validation errors

A Texture Stack is a group of textures that Unity samples at the same time, using the same UV coordinates. A validation error occurs when the Texture Stack or a texture in the Texture Stack is not in a valid state.

You can see the validation error in the Material InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
:

Virtual Texturing Error
Virtual Texturing Error

This validation error example is caused by a Texture Stack with three layers that only has two texture slots assigned.

Common reasons for Texture Stack validation errors include:

Errors also occur when one or more textures in the stack are not in a valid state. Causes of a texture validation error include:

  • The texture is not of type Texture2D (SVT does not support arrays or cube maps).

  • The texture uses a Mirror wrap mode.

  • The texture uses different clamping modes per axis (for example, repeating horizontally while clamping vertically).The texture’s resolution is not a power of two.

  • The aspect ratiosThe relationship of an image’s proportional dimensions, such as its width and height.
    See in Glossary
    of all textures are not the same.

  • The texture does not meet the minimum size of 128 by 128 pixelsThe smallest unit in a computer image. Pixel size depends on your screen resolution. Pixel lighting is calculated at every screen pixel. More info
    See in Glossary
    .

  • The texture does not have a mipmap.

  • The texture has Use Crunch compressionA method of storing data that reduces the amount of storage space it requires. See Texture Compression, Animation Compression, Audio Compression, Build Compression.
    See in Glossary
    enabled in the texture importer.

Build player error

For Unity to build a player using SVT, all materials must use valid textures with matching aspect ratios and have valid Virtual Texture properties (see Validation errors). If a material in your player build is in an invalid state, it causes a build error that appears in the console log.

Error naming convention

When Unity logs a validation error, it names the Texture Stacks according to the following convention:

  • The number of layers the Texture Stack has.
  • The Texture Stack’s layer names as set in ShaderGraph.

Here are two examples of this naming convention:

  • An error name in a Texture Stack with two layers: Texture 2(Layer_Name_1, NULL)
  • An error name in a Texture Stack with three layers: Texture 3 (Layer_Name_1, Layer_Name_2, NULL)

When an error appears in the console log, the error name also includes the material that uses the Texture Stack. For example:

  • ‘Texture Stack 2 (3_BaseColorMap, NULL)’ of material ‘materialname3’.
Marking textures as "Virtual Texturing Only"
Sparse Textures