CC3ConfigurableTextureUnit Class Reference
Inherits from | CC3TextureUnit : NSObject |
Declared in | CC3TextureUnit.h |
Overview
A texture unit that provides complete flexibility in defining the way the texture will be combined with the output of previous texture units.
Tasks
-
textureEnvironmentMode
property -
combineRGBFunction
property -
rgbSource0
property -
rgbSource1
property -
rgbSource2
property -
rgbOperand0
property -
rgbOperand1
property -
rgbOperand2
property -
combineAlphaFunction
property -
alphaSource0
property -
alphaSource1
property -
alphaSource2
property -
alphaOperand0
property -
alphaOperand1
property -
alphaOperand2
property -
isBumpMap
property
Properties
alphaOperand0
Defines the operand to be applied to the alpha component of alphaSource0 prior to it being used by the combiner.
@property (nonatomic, assign) GLenum alphaOperand0
Discussion
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.
Declared In
CC3TextureUnit.h
alphaOperand1
Defines the operand to be applied to the alpha component of alphaSource1 prior to it being used by the combiner.
@property (nonatomic, assign) GLenum alphaOperand1
Discussion
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.
Declared In
CC3TextureUnit.h
alphaOperand2
Defines the operand to be applied to the alpha component of alphaSource2 prior to it being used by the combiner.
@property (nonatomic, assign) GLenum alphaOperand2
Discussion
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.
Declared In
CC3TextureUnit.h
alphaSource0
Identifies the source texture for the alpha component used as argument zero in the texture function defined by the combineAlphaFunction property.
@property (nonatomic, assign) GLenum alphaSource0
Discussion
This property may be set to any of the following values: – GL_TEXTURE – use this texture – GL_CONSTANT – use the alpha component in the constantColor 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.
Declared In
CC3TextureUnit.h
alphaSource1
Identifies the source texture for the alpha components used as argument one in the texture function defined by the combineAlphaFunction property.
@property (nonatomic, assign) GLenum alphaSource1
Discussion
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.
Declared In
CC3TextureUnit.h
alphaSource2
Identifies the source texture for the alpha components used as argument two in the texture function defined by the combineAlphaFunction property.
@property (nonatomic, assign) GLenum alphaSource2
Discussion
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 constantColor property of this texture unit.
Declared In
CC3TextureUnit.h
combineAlphaFunction
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.
@property (nonatomic, assign) GLenum combineAlphaFunction
Discussion
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
Declared In
CC3TextureUnit.h
combineRGBFunction
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.
@property (nonatomic, assign) GLenum combineRGBFunction
Discussion
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
Declared In
CC3TextureUnit.h
isBumpMap
Returns whether this texture unit is configured as a bump-map.
@property (nonatomic, readonly) BOOL isBumpMap
Discussion
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.
Declared In
CC3TextureUnit.h
rgbOperand0
Defines the operand to be applied to the RGB components of rgbSource0 prior to them being used by the combiner.
@property (nonatomic, assign) GLenum rgbOperand0
Discussion
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.
Declared In
CC3TextureUnit.h
rgbOperand1
Defines the operand to be applied to the RGB components of rgbSource1 prior to them being used by the combiner.
@property (nonatomic, assign) GLenum rgbOperand1
Discussion
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.
Declared In
CC3TextureUnit.h
rgbOperand2
Defines the operand to be applied to the RGB components of rgbSource2 prior to them being used by the combiner.
@property (nonatomic, assign) GLenum rgbOperand2
Discussion
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.
Declared In
CC3TextureUnit.h
rgbSource0
Identifies the source texture for the RGB components used as argument zero in the texture function defined by the combineRGBFunction property.
@property (nonatomic, assign) GLenum rgbSource0
Discussion
This property may be set to any of the following values: – GL_TEXTURE – use this texture – GL_CONSTANT – use the color in the constantColor 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.
Declared In
CC3TextureUnit.h
rgbSource1
Identifies the source texture for the RGB components used as argument one in the texture function defined by the combineRGBFunction property.
@property (nonatomic, assign) GLenum rgbSource1
Discussion
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.
Declared In
CC3TextureUnit.h
rgbSource2
Identifies the source texture for the RGB components used as argument two in the texture function defined by the combineRGBFunction property.
@property (nonatomic, assign) GLenum rgbSource2
Discussion
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.
Declared In
CC3TextureUnit.h
textureEnvironmentMode
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.
@property (nonatomic, assign) GLenum textureEnvironmentMode
Discussion
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.
Declared In
CC3TextureUnit.h