Properties

CC3ConfigurableTextureUnit Class Reference

A texture unit that provides complete flexibility to define the way the texture will be combined with the output of previous texture units. More...

#import <CC3TextureUnit.h>

Inheritance diagram for CC3ConfigurableTextureUnit:
Inheritance graph
[legend]
Collaboration diagram for CC3ConfigurableTextureUnit:
Collaboration graph
[legend]

List of all members.

Properties

GLenum alphaOperand0
GLenum alphaOperand1
GLenum alphaOperand2
GLenum alphaSource0
GLenum alphaSource1
GLenum alphaSource2
GLenum combineAlphaFunction
GLenum combineRGBFunction
BOOL isBumpMap
GLenum rgbOperand0
GLenum rgbOperand1
GLenum rgbOperand2
GLenum rgbSource0
GLenum rgbSource1
GLenum rgbSource2
GLenum textureEnvironmentMode

Detailed Description

A texture unit that provides complete flexibility to define the way the texture will be combined with the output of previous texture units.


Property Documentation

- (GLenum) alphaOperand0 [read, write, assign]

Defines the operand to be applied to the alpha component of alphaSource0 prior to it being used by the combiner.

This property may be set to any of the following values:

  • GL_SRC_ALPHA - the source alpha.
  • GL_ONE_MINUS_SRC_ALPHA - the inverse of the source alpha.

The initial value of this property is GL_SRC_ALPHA, indicating that the alpha component of alphaSource0 will be used as-is by the combiner.

- (GLenum) alphaOperand1 [read, write, assign]

Defines the operand to be applied to the alpha component of alphaSource1 prior to it being used by the combiner.

See the notes for the alphaOperand0 property for the list of permitted values.

The initial value of this property is GL_SRC_ALPHA, indicating that the alpha component of alphaSource1 will be used as-is by the combiner.

- (GLenum) alphaOperand2 [read, write, assign]

Defines the operand to be applied to the alpha component of alphaSource2 prior to it being used by the combiner.

See the notes for the alphaOperand0 property for the list of permitted values.

The initial value of this property is GL_SRC_ALPHA, indicating that the alpha component of alphaSource2 will be used as-is by the combiner.

- (GLenum) alphaSource0 [read, write, assign]

Identifies the source texture for the alpha component used as argument zero in the texture function defined by the combineAlphaFunction property.

This property may be set to any of the following values:

  • GL_TEXTURE - use this texture
  • GL_TEXTUREn - use the texture assigned to one of the previous texture units, where n represents the index of the texture unit.
  • GL_CONSTANT - use the alpha component in the color property of this texture unit.
  • GL_PRIMARY_COLOR - use the color of the material.
  • GL_PREVIOUS - use the output of the previous texture unit in the chain, or the color of the material when processing texture unit zero.

The intial value of this property is GL_TEXTURE, indicating that the texture combiner will use this texture as argument zero in the texture combiner function.

- (GLenum) alphaSource1 [read, write, assign]

Identifies the source texture for the alpha components used as argument one in the texture function defined by the combineAlphaFunction property.

See the notes for the alphaSource0 property for the list of permitted values.

The intial value of this property is GL_PREVIOUS, indicating that the texture combiner will use the output of the previous texture unit in the chain, or the color of the material if processing texture unit zero.

- (GLenum) alphaSource2 [read, write, assign]

Identifies the source texture for the alpha components used as argument two in the texture function defined by the combineAlphaFunction property.

See the notes for the alphaSource0 property for the list of permitted values.

The intial value of this property is GL_CONSTANT, indicating that the texture combiner will use the alpha value in the color property of this texture unit.

- (GLenum) combineAlphaFunction [read, write, assign]

If the textureEnvironmentMode property is set to GL_COMBINE, this property defines the form of combining function used to combine the alpha component of the texture associated with this texture unit with the output of the previous texture unit.

This property may be set to any of the following values:

  • GL_REPLACE - simply use the texture identified by the rgbSource0 property.
  • GL_MODULATE - multiply together the alpha components of the textures identified by the rgbSource0 and rgbSource1 properties.
  • GL_ADD - add together the alpha components of the textures identified by the rgbSource0 and rgbSource1 properties.
  • GL_ADD_SIGNED - add together the alpha components of the textures identified by the rgbSource0 and rgbSource1 properties and then subtract 0.5.
  • GL_SUBTRACT - subtract the alpha component of the texture identified by rgbSource1 from that of the texture identified by rgbSource0.
  • GL_INTERPOLATE - interpolate the alpha components between the textures identified by the rgbSource0, rgbSource1 and rgbSource1 properties

The initial value of this property is set to GL_MODULATE, which replicates the behaviour of the CC3Texture class

- (GLenum) combineRGBFunction [read, write, assign]

If the textureEnvironmentMode property is set to GL_COMBINE, this property defines the form of combining function used to combine the RGB components of the texture associated with this texture unit with the output of the previous texture unit.

This property may be set to any of the following values:

  • GL_REPLACE - simply use the texture identified by the rgbSource0 property.
  • GL_MODULATE - multiply together the RGB components of the textures identified by the rgbSource0 and rgbSource1 properties.
  • GL_ADD - add together the RGB components of the textures identified by the rgbSource0 and rgbSource1 properties.
  • GL_ADD_SIGNED - add together the RGB components of the textures identified by the rgbSource0 and rgbSource1 properties and then subtract 0.5.
  • GL_SUBTRACT - subtract the RGB components of the texture identified by rgbSource1 from those of the texture identified by rgbSource0.
  • GL_INTERPOLATE - interpolate the RGB components between the textures identified by the rgbSource0, rgbSource1 and rgbSource1 properties
  • GL_DOT3_RGB or GL_DOT3_RGBA - treat the RGB components of the textures identified by the rgbSource0 and rgbSource1 properties as the three coordinates of a normal vector, take the dot product of the two vectors, and put the resulting scalar value into each of the 3 (RGB) or 4 (RGBA) components on output. This has the effect of modulating the underlying light colors in such a way that the surface appears to be three-dimensional.

The initial value of this property is set to GL_MODULATE, which replicates the behaviour of the CC3Texture class

- (BOOL) isBumpMap [read, assign]

Returns whether this texture unit is configured as a bump-map.

This implementation always returns YES if the textureEnvironmentMode property is set to GL_COMBINE and the combineRGBFunction property is set to either GL_DOT3_RGB or GL_DOT3_RGBA.

Implements CC3TextureUnit.

- (GLenum) rgbOperand0 [read, write, assign]

Defines the operand to be applied to the RGB components of rgbSource0 prior to them being used by the combiner.

This property may be set to any of the following values:

  • GL_SRC_COLOR - the source color.
  • GL_ONE_MINUS_SRC_COLOR - the inverse of the source color.
  • GL_SRC_ALPHA - the source alpha.
  • GL_ONE_MINUS_SRC_ALPHA - the inverse of the source alpha.

The initial value of this property is GL_SRC_COLOR, indicating that the RGB color of rgbSource0 will be used as-is by the combiner.

- (GLenum) rgbOperand1 [read, write, assign]

Defines the operand to be applied to the RGB components of rgbSource1 prior to them being used by the combiner.

See the notes for the rgbOperand0 property for the list of permitted values.

The initial value of this property is GL_SRC_COLOR, indicating that the RGB color of rgbSource1 will be used as-is by the combiner.

- (GLenum) rgbOperand2 [read, write, assign]

Defines the operand to be applied to the RGB components of rgbSource2 prior to them being used by the combiner.

See the notes for the rgbOperand2 property for the list of permitted values.

The initial value of this property is GL_SRC_ALPHA, indicating that the alpha component of rgbSource2 will be used by the combiner.

- (GLenum) rgbSource0 [read, write, assign]

Identifies the source texture for the RGB components used as argument zero in the texture function defined by the combineRGBFunction property.

This property may be set to any of the following values:

  • GL_TEXTURE - use this texture
  • GL_TEXTUREn - use the texture assigned to one of the previous texture units, where n represents the index of the texture unit.
  • GL_CONSTANT - use the color in the color property of this texture unit.
  • GL_PRIMARY_COLOR - use the color of the material.
  • GL_PREVIOUS - use the output of the previous texture unit in the chain, or the color of the material when processing texture unit zero.

The intial value of this property is GL_TEXTURE, indicating that the texture combiner will use this texture as argument zero in the texture combiner function.

- (GLenum) rgbSource1 [read, write, assign]

Identifies the source texture for the RGB components used as argument one in the texture function defined by the combineRGBFunction property.

See the notes for the rgbSource0 property for the list of permitted values.

The intial value of this property is GL_PREVIOUS, indicating that the texture combiner will use the output of the previous texture unit in the chain, or the color of the material if processing texture unit zero.

- (GLenum) rgbSource2 [read, write, assign]

Identifies the source texture for the RGB components used as argument two in the texture function defined by the combineRGBFunction property.

See the notes for the rgbSource0 property for the list of permitted values.

The intial value of this property is GL_CONSTANT, indicating that the texture combiner will use the value in the constantColor property of this texture unit.

- (GLenum) textureEnvironmentMode [read, write, assign]

Defines the texture function to be used when combining this texture unit with the output of the previous texture unit.

This can be set to one of several fixed texture functions (GL_ADD, GL_MODULATE, GL_DECAL, GL_BLEND, GL_REPLACE), in which case the remaining configuration properties of this class are ignored. Setting this property to GL_MODULATE replicates the default behaviour of the CC3Texture class.

Setting this property to GL_COMBINE activates the other configuration properties of this class, opening up significant additional configuration flexibility.

The initial value of this property is GL_COMBINE, indicating that all configuration properties are active.


The documentation for this class was generated from the following file: