SLGPUImageFilter Class Reference

Inherits from SLGPUImageOutput : NSObject
Conforms to SLGPUImageInput
Declared in SLGPUImageFilter.h

Overview

SLGPUImage’s base filter class

Filters and other subsequent elements in the chain conform to the SLGPUImageInput protocol, which lets them take in the supplied or processed texture from the previous link in the chain and do something with it. Objects one step further down the chain are considered targets, and processing can be branched by adding multiple targets to a single output or filter.

Initialization and teardown

– initWithVertexShaderFromString:fragmentShaderFromString:

Initialize with vertex and fragment shaders

- (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString

Parameters

vertexShaderString

Source code of the vertex shader to use

fragmentShaderString

Source code of the fragment shader to use

Discussion

You make take advantage of the SHADER_STRING macro to write your shaders in-line.

Declared In

SLGPUImageFilter.h

– initWithFragmentShaderFromString:

Initialize with a fragment shader

- (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString

Parameters

fragmentShaderString

Source code of fragment shader to use

Discussion

You may take advantage of the SHADER_STRING macro to write your shader in-line.

Declared In

SLGPUImageFilter.h

– initWithFragmentShaderFromFile:

Initialize with a fragment shader

- (id)initWithFragmentShaderFromFile:(NSString *)fragmentShaderFilename

Parameters

fragmentShaderFilename

Filename of fragment shader to load

Declared In

SLGPUImageFilter.h

Managing the display FBOs

– sizeOfFBO

Size of the frame buffer object

- (CGSize)sizeOfFBO

Declared In

SLGPUImageFilter.h