Instance Methods | Class Methods | Properties | List of all members
CC3TextureUnitTexture Class Reference

#import <CC3Texture.h>

Inheritance diagram for CC3TextureUnitTexture:
Inheritance graph

Instance Methods

(id) - initWithTexture:
- Instance Methods inherited from CC3Texture
(CCTexture *) - __deprecated
(NSString *) - constructorDescription
(void) - drawWithVisitor:
(void) - generateMipmap
(id) - initCubeColoredForAxes
(id) - initCubeFromFilePattern:
(id) - initCubeFromFilesPosX:negX:posY:negY:posZ:negZ:
(id) - initCubeWithPixelFormat:andPixelType:
(id) - initCubeWithPixelFormat:withPixelType:
(id) - initCubeWithSideLength:withPixelFormat:withPixelType:
(id) - initCubeWithSize:andPixelFormat:andPixelType:
(id) - initFromFile:
(id) - initWithCCTexture:
(id) - initWithCGImage:
(id) - initWithPixelFormat:andPixelType:
(id) - initWithPixelFormat:withPixelType:
(id) - initWithSize:andPixelFormat:andPixelType:
(id) - initWithSize:withColor:
(id) - initWithSize:withPixelFormat:withPixelType:
(void) - remove
(void) - replacePixels:inTarget:withContent:
(void) - resizeTo:
- Instance Methods inherited from CC3Identifiable
(id) - copy
(id) - copyAsClass:
(void) - copyUserDataFrom:
(id) - copyWithName:
(id) - copyWithName:asClass:
(id) - copyWithZone:withName:
(id) - copyWithZone:withName:asClass:
(BOOL) - deriveNameFrom:
(BOOL) - deriveNameFrom:usingSuffix:
(NSString *) - fullDescription
(id) - init
(id) - initAtIndex:fromPODResource:
(void) - initUserData
(id) - initWithName:
(id) - initWithTag:
(id) - initWithTag:withName:
(GLuint) - nextTag
(void) - populateFrom:

Class Methods

(id) + textureWithTexture:
- Class Methods inherited from CC3Texture
(void) + addTexture:
(NSString *) + cachedTexturesDescription
(BOOL) + defaultShouldFlipHorizontallyOnLoad
(BOOL) + defaultShouldFlipVerticallyOnLoad
(ccTexParams) + defaultTextureParameters
(CC3Texture *) + getTextureNamed:
(BOOL) + isPreloading
(void) + removeAllTextures
(void) + removeTexture:
(void) + removeTextureNamed:
(void) + setDefaultShouldFlipHorizontallyOnLoad:
(void) + setDefaultShouldFlipVerticallyOnLoad:
(void) + setDefaultTextureParameters:
(void) + setIsPreloading:
(void) + setShouldCacheAssociatedCCTextures:
(void) + setShouldGenerateMipmaps:
(BOOL) + shouldCacheAssociatedCCTextures
(BOOL) + shouldGenerateMipmaps
(id) + textureCubeColoredForAxes
(id) + textureCubeFromFilePattern:
(id) + textureCubeFromFilesPosX:negX:posY:negY:posZ:negZ:
(id) + textureCubeWithPixelFormat:andPixelType:
(id) + textureCubeWithPixelFormat:withPixelType:
(id) + textureCubeWithSideLength:withPixelFormat:withPixelType:
(id) + textureCubeWithSize:andPixelFormat:andPixelType:
(id) + textureFromFile:
(NSString *) + textureNameFromFilePath:
(id) + textureWithCCTexture:
(id) + textureWithCGImage:
(id) + textureWithPixelFormat:andPixelType:
(id) + textureWithPixelFormat:withPixelType:
(id) + textureWithSize:andPixelFormat:andPixelType:
(id) + textureWithSize:withColor:
(id) + textureWithSize:withPixelFormat:withPixelType:
- Class Methods inherited from CC3Identifiable
(GLint) + instanceCount
(void) + resetTagAllocation


- Properties inherited from CC3Texture
CCTexture *ccTexture2D __deprecated
CCTexture * ccTexture
CGSize coverage
BOOL hasAlpha
BOOL hasMipmap
BOOL hasPremultipliedAlpha
GLenum horizontalWrappingFunction
GLenum initialAttachmentFace
BOOL isBumpMap
BOOL isPOTHeight
BOOL isTexture2D
BOOL isTextureCube
BOOL isUpsideDown
CC3Vector lightDirection
GLenum magnifyingFunction
GLenum minifyingFunction
GLenum pixelFormat
GLenum pixelType
GLenum samplerSemantic
BOOL shouldFlipHorizontallyOnLoad
BOOL shouldFlipVerticallyOnLoad
CC3IntSize size
GLuint textureID
ccTexParams textureParameters
GLenum textureTarget
GLenum verticalWrappingFunction
- Properties inherited from CC3Identifiable
NSObject *sharedUserData __deprecated
NSString * name
NSString * nameSuffix
GLint podIndex
BOOL shouldIncludeInDeepCopy
GLuint tag
NSObject * userData
- Properties inherited from <CC3Cacheable>
NSString * name

Detailed Description

CC3TextureUnitTexture is a specialized CC3Texture subclass that actually wraps another texture instance and combines it with an instance of a texture unit to define additional environmental configuration information about the use of the texture in multi-texturing under fixed-pipeline rendering used by OpenGL ES 1.1 on iOS, or OpenGL on OSX without shaders.

This class is generally not used for multi-texturing under programmable-pipeline rendering used by OpenGL ES 2.0 on, or OpenGL on OSX with shaders, as you will generally handle multitexturing in the shader code. However, it is possible to use an instance of this class with a programmable-pipeline shader if your shader is designed to make use of the texture unit configuration content. This can be used as a mechanism for supporting the same multi-texturing configuration between both fixed and programmable pipelines.

You instantiate an instance of CC3TextureUnitTexture directly, using any of the instance creation or initializaton methods defined by the CC3Texture superclass. Or, if you already have an instance of a CC3Texture, you can wrap it in an instance of CC3TextureUnitTexture by using the textureWithTexture: or initWithTexture: creation and initialization methods of this class.

You can then create an instance of CC3TextureUnit, configure it appropriately, and set it into the textureUnit property of your CC3TextureUnitTexture instance. By adding multiple CC3TextureUnitTexture instances to your CC3Material, you can combine textures creatively.

For example, to configure a material for bump-mapping, add a texture that contains a normal vector at each pixel instead of a color, and set the textureUnit property of the texture to a CC3BumpMapTextureUnit. Then add another texture, containing the image that will be visible, to the material. The material will combine these two textures, as specified by the CC3TextureUnit held by the second texture.

Method Documentation

- (id) initWithTexture: (CC3Texture *)  texture

Initializes this instance on the specified underlying texture.

The name property of this instance will set to that of the specified texture.

+ (id) textureWithTexture: (CC3Texture *)  texture

Allocates and initializes an autoreleased instance on the specified underlying texture.

The name property of this instance will set to that of the specified texture.

Property Documentation

- (CC3Texture*) texture

The CC3Texture texture being managed by this instance.

This property is populated automatically during instance creation and loading.

- (CC3TextureUnit*) textureUnit

The texture environment settings that are applied to the texture unit that draws this texture, when this texture participates in multi-texturing under fixed-pipeline rendering.

The texture unit is optional, and this propety may be left as nil to provide standard single texture rendering. The default value of this property is nil.

The texture unit can be used to configure how the texture will be combined with other textures when using multi-texturing. When the material supports multiple textures, each texture should contain a texture unit that describes how the GL engine should combine that texture with the textures that have already been applied.

Different subclasses of CC3TextureUnit provide different customizations for combining textures. The CC3BumpMapTextureUnit provides easy settings for DOT3 bump-mapping, and CC3ConfigurableTextureUnit provides complete flexibility in setting texture environment settings.

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