Skip to main content

sRGB and import settings

After reading this page, you will know the import settings behind the most common cause of "the mask is applied but the effect looks wrong".

Why sRGB must be off​

sRGB (Color Texture) tells Unity "this texture is a color that people will see." When it is on, Unity applies gamma correction, so the stored pixel values and the values the shader reads are different.

That is correct for color. A mask is numbers, though. A gray baked at 0.5 must be read as 0.5 by the shader.

Texture typesRGBReason
Grayscale masks (output from Paint, Image, Gradient, Bridge, MatCap Gloss)OffThe value must be read as it is
Packed texture made with the Mask CombinerOffAll four channels hold values
Grayscale masks from Mask Output are already set correctly

Mask Output imports grayscale masks with sRGB turned off. You only need to check masks that you imported from outside.

Check and fix​

  1. Select the texture in the Project window.
  2. In the Inspector, turn off sRGB (Color Texture).
  3. Press Apply. The change does not take effect until you press it.

Other import settings to check​

SettingRecommended for masksReason
sRGB (Color Texture)OffSee above
Alpha Is TransparencyOffStops Unity from changing values when the alpha channel is used as a mask channel
CompressionNone or High QualityBlock compression blurs the channels. This is especially visible in packed textures
Generate Mip MapsYour choiceEdges look softer at a distance, and thin masks get blurry
Wrap ModeClampThere is no reason for the mask to repeat outside the UV area
Max Size512 to 1024Only the mask boundary matters
Packed textures are especially sensitive to compression

DXT and BC compression do not treat channels independently. This is why the R channel boundary can look smeared into G. If a packed texture looks wrong, suspect compression first.

Check the UV​

A mask is read using the same UV map as the main texture. If the effect appears in a completely wrong place, the slot may be set to use a UV channel other than UV1.

Mask Maker builds masks from the UVs of the loaded mesh, so a mask made inside the tool always uses the same UV as the main texture.