GLKEffectPropertyTexture Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/GLKit.framework
Availability
Available in iOS 5.0 and later.
Declared in
GLKEffectPropertyTexture.h

Overview

The GLKEffectPropertyTexture class defines properties that are used to configure an OpenGL texturing operation. The texturing operation combines an input color and a color sampled from the texture and outputs a new color to the next stage of calculations. The envMode property determines the function used to calculate the output color from the two input colors.

If an effect only includes a single texture property, then the input color is the lighting color calculated by the lighting stage of the graphics pipeline. An effect can also include multiple GLKEffectPropertyTexture objects. When an effect includes multiple properties, the first texture stage uses the lighting color as the first input color. Each texture stage after that uses the output of the previous stage as the input color.

Tasks

Configuring Texture Properties

Properties

enabled

A Boolean value that indicates whether this texture is used to texture drawn primitives.

@property(nonatomic, assign) GLboolean enabled
Discussion

If the value is GL_TRUE, then the texture is applied to the primitive. If the value is GL_FALSE, the texture is skipped. The default value is GL_TRUE.

Availability
  • Available in iOS 5.0 and later.
Declared In
GLKEffectPropertyTexture.h

envMode

The mode the texture uses to compute its output fragment color. See “Texturing Modes”.

@property(nonatomic, assign) GLint envMode
Discussion

The default value is GLKTextureEnvModeModulate.

Availability
  • Available in iOS 5.0 and later.
Declared In
GLKEffectPropertyTexture.h

name

The OpenGL name for the texture being sampled by this texture stage.

@property(nonatomic, assign) GLuint name
Availability
  • Available in iOS 5.0 and later.
Declared In
GLKEffectPropertyTexture.h

target

The kind of texture pointed to by the texture stage. See “Texture Target Types.”

@property(nonatomic, assign) GLKTextureTarget target
Discussion

The default value is GLKTextureTarget2D.

Availability
  • Available in iOS 5.0 and later.
Declared In
GLKEffectPropertyTexture.h

Constants

Texture Target Types

The kind of texture pointed to by the property.

typedef enum
{
   GLKTextureTarget2D = GL_TEXTURE_2D,
   GLKTextureTargetCubeMap = GL_TEXTURE_CUBE_MAP,
   GLKTextureTargetCt = 2
} GLKTextureTarget;
Constants
GLKTextureTarget2D

The texture is a 2D texture.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.

GLKTextureTargetCubeMap

The texture is a set of six textures that make up a cube map.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.

GLKTextureTargetCt

The number of items in the enumeration.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.

Texturing Modes

The mode used to combine the texture with other color components.

typedef enum
{
   GLKTextureEnvModeReplace,
   GLKTextureEnvModeModulate,
   GLKTextureEnvModeDecal
} GLKTextureEnvMode;
Constants
GLKTextureEnvModeReplace

The output color is set to the color fetched from the texture. The input color is ignored.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.

GLKTextureEnvModeModulate

The output color is calculated by multiplying the texture’s color by the input color.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.

GLKTextureEnvModeDecal

The output color is calculated by using the texture’s alpha component to blend the texture’s color with the input color.

Available in iOS 5.0 and later.

Declared in GLKEffectPropertyTexture.h.