Class TextureAttributes


  • public class TextureAttributes
    extends NodeComponent
    The TextureAttributes object defines attributes that apply to texture mapping. The texture attributes include the following:

    • Texture mode - defines how the object and texture colors are blended. The mode may be one of the following:
      • MODULATE - modulates the incoming color with the texture color.

          C' = C Ct
      • DECAL - applies the texture color to the incoming color as a decal.

          C'rgb = Crgb (1 - Cta) + Ctrgb Cta

          C'a = Ca

      • BLEND - blends the texture blend color with the incoming color.

          C'rgb = Crgb (1 - Ctrgb) + Cbrgb Ctrgb

          C'a = Ca Cta

        Note that if the texture format is INTENSITY, alpha is computed identically to red, green, and blue:

          C'a = Ca (1 - Cta) + Cba Cta
      • REPLACE - replaces the incoming color with the texture color.

          C' = Ct

      • COMBINE - combines the object color with the texture color or texture blend color according to the combine operation as specified in the texture combine mode.
      C = Incoming color to the texture unit state. For texture unit state 0, C is the object color Ct = Texture color
      Cb = Texture blend color

    • Combine Mode - defines the combine operation when texture mode specifies COMBINE. The combine mode includes the following:

      • COMBINE_REPLACE

          C' = C0

      • COMBINE_MODULATE

          C' = C0 C1
      • COMBINE_ADD

          C' = C0 + C1

      • COMBINE_ADD_SIGNED

          C' = C0 + C1 - 0.5

      • COMBINE_SUBTRACT

          C' = C0 - C1

      • COMBINE_INTERPOLATE

          C' = C0 C2 + C1 (1 - C2)

      • COMBINE_DOT3

          C' = 4 * ( (C0r - 0.5) * (C1r - 0.5) + (C0g - 0.5) * (C1g - 0.5) + (C0b - 0.5) * (C1b - 0.5))

          where CNx is the x component of the Nth color operand in the combine operation.

          The value C' will be placed to the all three r,g,b components or the a component of the output.

    • where C0, C1 and C2 are determined by the color source, and the color operand.

    • Combine Color Source - defines the source for a color operand in the combine operation. The color source includes the following:

      • COMBINE_OBJECT_COLOR - object color

      • COMBINE_TEXTURE_COLOR - texture color

      • COMBINE_CONSTANT_COLOR - texture blend color

      • COMBINE_PREVIOUS_TEXTURE_UNIT_STATE - color from the previous texture unit state. For texture unit state 0, this is equivalent to COMBINE_OBJECT_COLOR.

    • Combine Color Function - specifies the function for a color operand in the combine operation. The valid values are:

      • COMBINE_SRC_COLOR - the color function is f = Crgb

      • COMBINE_ONE_MINUS_SRC_COLOR - the color function is f = (1 - Crgb)

      • COMBINE_SRC_ALPHA - the color function is f = Ca

      • COMBINE_ONE_MINUS_SRC_ALPHA - the color function is f = (1 - Ca)

    • Combine scale factor - specifies the scale factor to be applied to the output color of the combine operation. The valid values include: 1, 2, or 4.
    • Transform - the texture transform object used to transform texture coordinates. The texture transform can translate, scale, or rotate the texture coordinates before the texture is applied to the object.
    • Blend color - the constant texture blend color
    • Perspective correction - the perspective correction mode used for color and texture coordinate interpolation. One of the following:
      • NICEST - uses the nicest (highest quality) available method for texture mapping perspective correction.
      • FASTEST - uses the fastest available method for texture mapping perspective correction.
    • Texture color table - defines a table that is used to look up texture colors before applying the texture mode.
See Also:
Appearance, Canvas3D.queryProperties()