API Docs for:
Show:

gs.EffectInfo Class

An effect-info encapsulates all necessary information to register and compile a custom GLSL shader effect. To actually use a custom effect, it is necessary create a custom effect class as well and derive from gs.GraphicEffect class.

Constructor

gs.EffectInfo

(
  • [data=null]
)

Parameters:

  • [data=null] Object optional
    • An optional data-bundle to create the effect-info from. Can be null.

Properties

defines

String

An array of GLSL preprocessor definitions. Each entry represents a single preprocessor definition. The preprocessor definition must be in correct syntax. For Example:

#define PI 3.14159

functionCalls

String

An array of GLSL function calls. Each entry represents a single function call. The function call must be in correct syntax including the trailing semicolon. For Example:

my_powerful_effect();

The function calls are paste into the main-function of the fragment-shader.

functions

String

An array of GLSL function definitions. Each entry represents a single function definition. The function definition must be in correct syntax. For Example:

void texture_color() { gl_FragColor = texture2D(Texture0, textureCoord); }

The function definitions are pasted after all define, uniform and varying declarations.

id

Number

The internal ID number.

name

String

The effect name. That name must match the name defined in the effect class.

type

gs.GraphicEffectType

The effect type.

uniforms

String

An array of GLSL uniform declarations. Each entry represents a single uniform declaration. The uniform declaration must be in correct syntax including the trailing semicolon. For Example:

uniform float MyValue;

varying

String

An array of GLSL varying declarations. Each entry represents a single varying declaration. The varying declaration must be in correct syntax including the trailing semicolon. For Example:

varying vec2 textureCoord;