SPBaseEffect Class Reference
| Inherits from | NSObject |
| Declared in | SPBaseEffect.h |
Overview
An SPBaseEffect simplifies the rendering of colored and/or textured polygons.
Configure a base effect by updating its state properties. When you call prepareToDraw, it
will choose the optimal shader program for the given settings and will activate that program.
Alpha and matrix uniforms will be passed to the program automatically, and the texture will be
bound.
Tasks
Methods
-
– prepareToDrawActivates the optimal shader program for the current settings; alpha and matrix uniforms are passed to the program right away, and the texture (if available) is bound.
Properties
-
mvpMatrixThe modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
property -
textureThe texture that’s projected onto the quad, or
propertynilif there is none. (Default:nil) -
premultipliedAlphaIndicates if the color values of texture and vertices use premultiplied alpha. (Default:
propertyNO) -
useTintingIndicates if the colors of the vertices should tint the texture colors. The iPad 1 profits immensely from the very simple fragment shader that can be used when tinting is deactivated. Note that an alpha value different to “1” will still force tinting to be used. (Default:
propertyYES) -
alphaThe alpha value with which every vertex color will be multiplied. (Default: 1)
property -
attribPositionThe index of the vertex attribute storing the position vector.
property -
attribTexCoordsThe index of the vertex attribute storing the two texture coordinates.
property -
attribColorThe index of the vertex attribute storing the color vector.
property
Properties
alpha
The alpha value with which every vertex color will be multiplied. (Default: 1)
@property (nonatomic, assign) float alphaDiscussion
The alpha value with which every vertex color will be multiplied. (Default: 1)
Declared In
SPBaseEffect.hattribColor
The index of the vertex attribute storing the color vector.
@property (nonatomic, readonly) int attribColorDiscussion
The index of the vertex attribute storing the color vector.
Declared In
SPBaseEffect.hattribPosition
The index of the vertex attribute storing the position vector.
@property (nonatomic, readonly) int attribPositionDiscussion
The index of the vertex attribute storing the position vector.
Declared In
SPBaseEffect.hattribTexCoords
The index of the vertex attribute storing the two texture coordinates.
@property (nonatomic, readonly) int attribTexCoordsDiscussion
The index of the vertex attribute storing the two texture coordinates.
Declared In
SPBaseEffect.hmvpMatrix
The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
@property (nonatomic, copy) SPMatrix *mvpMatrixDiscussion
The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
Declared In
SPBaseEffect.hpremultipliedAlpha
Indicates if the color values of texture and vertices use premultiplied alpha. (Default: NO)
@property (nonatomic, assign) BOOL premultipliedAlphaDiscussion
Indicates if the color values of texture and vertices use premultiplied alpha. (Default: NO)
Declared In
SPBaseEffect.htexture
The texture that’s projected onto the quad, or nil if there is none. (Default: nil)
@property (nonatomic, strong) SPTexture *textureDiscussion
The texture that’s projected onto the quad, or nil if there is none. (Default: nil)
Declared In
SPBaseEffect.huseTinting
Indicates if the colors of the vertices should tint the texture colors. The iPad 1 profits
immensely from the very simple fragment shader that can be used when tinting is deactivated.
Note that an alpha value different to “1” will still force tinting to be used. (Default: YES)
@property (nonatomic, assign) BOOL useTintingDiscussion
Indicates if the colors of the vertices should tint the texture colors. The iPad 1 profits
immensely from the very simple fragment shader that can be used when tinting is deactivated.
Note that an alpha value different to “1” will still force tinting to be used. (Default: YES)
Declared In
SPBaseEffect.hInstance Methods
prepareToDraw
Activates the optimal shader program for the current settings; alpha and matrix uniforms are passed to the program right away, and the texture (if available) is bound.
- (void)prepareToDrawDiscussion
Activates the optimal shader program for the current settings; alpha and matrix uniforms are passed to the program right away, and the texture (if available) is bound.
Declared In
SPBaseEffect.h