Package | starling.rendering |
Class | public class FilterEffect |
Inheritance | FilterEffect Effect Object |
Subclasses | MeshEffect |
For more information about the usage and creation of effects, please have a look at the documentation of the parent class, "Effect".
See also
Property | Defined By | ||
---|---|---|---|
mvpMatrix3D : Matrix3D The MVP (modelview-projection) matrix transforms vertices into clipspace. | Effect | ||
onRestore : Function The function that you provide here will be called after a context loss. | Effect | ||
texture : Texture The texture to be mapped onto the vertices. | FilterEffect | ||
textureRepeat : Boolean Indicates if pixels at the edges will be repeated or clamped. | FilterEffect | ||
textureSmoothing : String The smoothing filter that is used for the texture. | FilterEffect | ||
vertexFormat : VertexDataFormat [override] [read-only] The data format that this effect requires from the VertexData that it renders:
"position:float2, texCoords:float2" | FilterEffect |
Property | Defined By | ||
---|---|---|---|
indexBuffer : IndexBuffer3D [read-only] The internally used index buffer used on rendering. | Effect | ||
indexBufferSize : int [read-only] The current size of the index buffer (in number of indices). | Effect | ||
program : Program [read-only] Returns the current program, either by creating a new one (via
createProgram) or by getting it from the Painter. | Effect | ||
programBaseName : String Returns the base name for the program. | Effect | ||
programName : String [read-only] Returns the full name of the program, which is used to register it at the current
Painter. | Effect | ||
programVariantName : uint [override] [read-only] Override this method if the effect requires a different program depending on the
current settings. | FilterEffect | ||
vertexBuffer : VertexBuffer3D [read-only] The internally used vertex buffer used on rendering. | Effect | ||
vertexBufferSize : int [read-only] The current size of the vertex buffer (in blocks of 32 bits). | Effect |
Method | Defined By | ||
---|---|---|---|
Creates a new FilterEffect instance. | FilterEffect | ||
dispose():void Purges the index- and vertex-buffers. | Effect | ||
purgeBuffers(vertexBuffer:Boolean = true, indexBuffer:Boolean = true):void Purges one or both of the vertex- and index-buffers. | Effect | ||
render(firstIndex:int = 0, numTriangles:int = -1):void Draws the triangles described by the index- and vertex-buffers, or a range of them. | Effect | ||
uploadIndexData(indexData:IndexData, bufferUsage:String = staticDraw):void Uploads the given index data to the internal index buffer. | Effect | ||
uploadVertexData(vertexData:VertexData, bufferUsage:String = staticDraw):void Uploads the given vertex data to the internal vertex buffer. | Effect |
Method | Defined By | ||
---|---|---|---|
afterDraw(context:Context3D):void [override] This method is called by render, directly after
context.drawTriangles. | FilterEffect | ||
beforeDraw(context:Context3D):void [override] This method is called by render, directly before
context.drawTriangles. | FilterEffect | ||
Creates the program (a combination of vertex- and fragment-shader) used to render
the effect with the current settings. | Effect | ||
tex(resultReg:String, uvReg:String, sampler:int, texture:Texture, convertToPmaIfRequired:Boolean = true):String [static] Creates an AGAL source string with a tex operation, including an options
list with the appropriate format flag. | FilterEffect |
Constant | Defined By | ||
---|---|---|---|
STD_VERTEX_SHADER : String [static] The AGAL code for the standard vertex shader that most filters will use. | FilterEffect | ||
VERTEX_FORMAT : VertexDataFormat [static] The vertex format expected by uploadVertexData:
"position:float2, texCoords:float2" | FilterEffect |
programVariantName | property |
programVariantName:uint
[read-only] [override] Override this method if the effect requires a different program depending on the current settings. Ideally, you do this by creating a bit mask encoding all the options. This method is called often, so do not allocate any temporary objects when overriding.
Reserve 4 bits for the variant name of the base class.
protected function get programVariantName():uint
texture | property |
texture:Texture
The texture to be mapped onto the vertices.
public function get texture():Texture
public function set texture(value:Texture):void
textureRepeat | property |
textureRepeat:Boolean
Indicates if pixels at the edges will be repeated or clamped. Only works for power-of-two textures.
The default value is false
.
public function get textureRepeat():Boolean
public function set textureRepeat(value:Boolean):void
textureSmoothing | property |
textureSmoothing:String
The smoothing filter that is used for the texture.
The default value is bilinear
.
public function get textureSmoothing():String
public function set textureSmoothing(value:String):void
vertexFormat | property |
vertexFormat:VertexDataFormat
[read-only] [override] The data format that this effect requires from the VertexData that it renders:
"position:float2, texCoords:float2"
public function get vertexFormat():VertexDataFormat
FilterEffect | () | Constructor |
public function FilterEffect()
Creates a new FilterEffect instance.
afterDraw | () | method |
override protected function afterDraw(context:Context3D):void
This method is called by render
, directly after
context.drawTriangles
. Resets texture and vertex buffer attributes.
Parameters
context:Context3D |
beforeDraw | () | method |
override protected function beforeDraw(context:Context3D):void
This method is called by render
, directly before
context.drawTriangles
. It activates the program and sets up
the context with the following constants and attributes:
vc0-vc3
— MVP matrixva0
— vertex position (xy)va1
— texture coordinates (uv)fs0
— textureParameters
context:Context3D |
tex | () | method |
protected static function tex(resultReg:String, uvReg:String, sampler:int, texture:Texture, convertToPmaIfRequired:Boolean = true):String
Creates an AGAL source string with a tex
operation, including an options
list with the appropriate format flag. This is just a convenience method forwarding
to the respective RenderUtil method.
Parameters
resultReg:String | |
uvReg:String | |
sampler:int | |
texture:Texture | |
convertToPmaIfRequired:Boolean (default = true )
|
String |
See also
STD_VERTEX_SHADER | Constant |
public static const STD_VERTEX_SHADER:String
The AGAL code for the standard vertex shader that most filters will use. It simply transforms the vertex coordinates to clip-space and passes the texture coordinates to the fragment program (as 'v0').
VERTEX_FORMAT | Constant |
public static const VERTEX_FORMAT:VertexDataFormat
The vertex format expected by uploadVertexData
:
"position:float2, texCoords:float2"