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
-
– 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.
Properties
-
mvpMatrix
The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
property -
texture
The texture that’s projected onto the quad, or
propertynil
if there is none. (Default:nil
) -
premultipliedAlpha
Indicates if the color values of texture and vertices use premultiplied alpha. (Default:
propertyNO
) -
useTinting
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:
propertyYES
) -
alpha
The alpha value with which every vertex color will be multiplied. (Default: 1)
property -
attribPosition
The index of the vertex attribute storing the position vector.
property -
attribTexCoords
The index of the vertex attribute storing the two texture coordinates.
property -
attribColor
The 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 alpha
Discussion
The alpha value with which every vertex color will be multiplied. (Default: 1)
Declared In
SPBaseEffect.h
attribColor
The index of the vertex attribute storing the color vector.
@property (nonatomic, readonly) int attribColor
Discussion
The index of the vertex attribute storing the color vector.
Declared In
SPBaseEffect.h
attribPosition
The index of the vertex attribute storing the position vector.
@property (nonatomic, readonly) int attribPosition
Discussion
The index of the vertex attribute storing the position vector.
Declared In
SPBaseEffect.h
attribTexCoords
The index of the vertex attribute storing the two texture coordinates.
@property (nonatomic, readonly) int attribTexCoords
Discussion
The index of the vertex attribute storing the two texture coordinates.
Declared In
SPBaseEffect.h
mvpMatrix
The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
@property (nonatomic, copy) SPMatrix *mvpMatrix
Discussion
The modelview-projection matrix used for rendering. Any vertex will be multiplied with this matrix. (Default: identity matrix)
Declared In
SPBaseEffect.h
premultipliedAlpha
Indicates if the color values of texture and vertices use premultiplied alpha. (Default: NO
)
@property (nonatomic, assign) BOOL premultipliedAlpha
Discussion
Indicates if the color values of texture and vertices use premultiplied alpha. (Default: NO
)
Declared In
SPBaseEffect.h
texture
The texture that’s projected onto the quad, or nil
if there is none. (Default: nil
)
@property (nonatomic, strong) SPTexture *texture
Discussion
The texture that’s projected onto the quad, or nil
if there is none. (Default: nil
)
Declared In
SPBaseEffect.h
useTinting
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 useTinting
Discussion
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.h
Instance 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)prepareToDraw
Discussion
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