Using texture modes

The Texture mode in TextureAttributes controls how texture pixels affect shape color

REPLACE

Texture color completely replaces the shape's material color

DECAL

Texture color is blended as a decal on top of the shape's material color

MODULATE

Texture color modulates (filters) the shape's material color

BLEND

Texture color blends the shape's material color with an arbitrary blend color

 

Mode

Result color

Result transparency

REPLACE

Trgb

Ta

DECAL

Srgb*(1-Ta)+Trgb*Ta

Sa

MODULATE

Srgb*Trgb

Sa*Ta

BLEND

Srgb*(1-Trgb)+Brgb*Trgb

Sa*Ta

Where:

  • Srgb is the color of the shape being texture mapped

  • Sa is the alpha of the shape being texture mapped

  • Trgb is the texture pixel color

  • Ta is the texture pixel alpha

  • Brgb is the shape blend color

  • Ba is the shape blend alpha