### codeanticode.glgraphics

# Class GLModelEffect

- `java.lang.Object`
- - `codeanticode.glgraphics.GLModelEffect`

Implemented Interfaces:
  PConstants

`public class GLModelEffect`
`extends java.lang.Object`
`implements PConstants`

This package provides classes to facilitate the handling of opengl textures, glsl shaders and off-screen rendering in Processing.

Author:
  Andres Colubri

  ## Constructor Summary
  `GLModelEffect()` Default constructor.
  `GLModelEffect(PApplet parent, String filename)`
  `GLModelEffect(PApplet parent, URL url)` Creates an instance of GLTextureFilter, loading the filter from a URL.

  ## Method Summary
  `void` | `apply(GLModel model)`
  `void` | `apply(GLModel[] models)`
  `void` | `disableVertexAttribs()`
  `void` | `enableVertexAttribs()`
  `String` | `getDescription()` Returns the description of the filter.
  `GLModelEffectParameter` | `getParameter(String paramName)` Returns the parameter with the provided name.
  `GLModelEffectParameter` | `getParameter(int i)` Returns the i-th parameter.
  `int` | `getParameterCount()` Get number of parameters.
  `String` | `getParameterLabel(int i)` Returns the label of the i-th parameter.
  `String` | `getParameterName(int i)` Returns the name of the i-th parameter.
  `int` | `getParameterType(int i)` Returns the type of the i-th parameter.
  `void` | `setParameterValue(String paramName, float value)` Sets the parameter value when the type is float.
  `void` | `setParameterValue(String paramName, float[] value)` Sets the parameter value for any type.
  `void` | `setParameterValue(String paramName, int value)` Sets the parameter value when the type is int.
  `void` | `setParameterValue(String paramName, int i, float value)` Sets the ith value for the parameter (only valid for vec or mat types).
  `void` | `setParameterValue(String paramName, int i, int j, float value)` Sets the (ith, jth) value for the parameter (only valid for mat types).
  `void` | `setParameterValue(int n, float value)` Sets the parameter value when the type is float.
  `void` | `setParameterValue(int n, float[] value)` Sets the parameter value for any type.
  `void` | `setParameterValue(int n, int value)` Sets the parameter value when the type is int.
  `void` | `setParameterValue(int n, int i, float value)` Sets the ith value for the parameter (only valid for vec or mat types).
  `void` | `setParameterValue(int n, int i, int j, float value)` Sets the (ith, jth) value for the parameter (only valid for mat types).
  `void` | `setParameterValues(float[] ...values)` Sets all the value for all the parameters, by means of a parameter list of variable length.
  `void` | `setTextures(GLTexture[] textures)`
  `void` | `setVertexAttribs(int[] attribVBO, String[] attribName, int[] attribSize)`
  `void` | `start()`
  `void` | `stop()`

## Constructor Details

### GLModelEffect

    public GLModelEffect()

> Default constructor.

### GLModelEffect

    public GLModelEffect(PApplet parent,
                         String filename)

### GLModelEffect

    public GLModelEffect(PApplet parent,
                         URL url)

> Creates an instance of GLTextureFilter, loading the filter from a URL.

## Method Details

### apply

    public void apply(GLModel model)

### apply

    public void apply(GLModel[] models)

### disableVertexAttribs

    public void disableVertexAttribs()

### enableVertexAttribs

    public void enableVertexAttribs()

### getDescription

    public String getDescription()

> Returns the description of the filter.
> Returns:
>   String

### getParameter

    public GLModelEffectParameter getParameter(String paramName)

> Returns the parameter with the provided name.
> Returns:
>   GLModelEffectParameter

### getParameter

    public GLModelEffectParameter getParameter(int i)

> Returns the i-th parameter.
> Returns:
>   GLModelEffectParameter

### getParameterCount

    public int getParameterCount()

> Get number of parameters.
> Returns:
>   int

### getParameterLabel

    public String getParameterLabel(int i)

> Returns the label of the i-th parameter.
> Returns:
>   String

### getParameterName

    public String getParameterName(int i)

> Returns the name of the i-th parameter.
> Returns:
>   String

### getParameterType

    public int getParameterType(int i)

> Returns the type of the i-th parameter.
> Returns:
>   int

### setParameterValue

    public void setParameterValue(String paramName,
                                  float value)

> Sets the parameter value when the type is float.
> Parameters:

### setParameterValue

    public void setParameterValue(String paramName,
                                  float[] value)

> Sets the parameter value for any type. When the type is int or float, the first element of the value array is considered.
> Parameters:
>   `value` - float[]

### setParameterValue

    public void setParameterValue(String paramName,
                                  int value)

> Sets the parameter value when the type is int.
> Parameters:

### setParameterValue

    public void setParameterValue(String paramName,
                                  int i,
                                  float value)

> Sets the ith value for the parameter (only valid for vec or mat types).
> Parameters:
>   `value` - float

### setParameterValue

    public void setParameterValue(String paramName,
                                  int i,
                                  int j,
                                  float value)

> Sets the (ith, jth) value for the parameter (only valid for mat types).
> Parameters:
>   `value` - float

### setParameterValue

    public void setParameterValue(int n,
                                  float value)

> Sets the parameter value when the type is float.
> Parameters:

### setParameterValue

    public void setParameterValue(int n,
                                  float[] value)

> Sets the parameter value for any type. When the type is int or float, the first element of the value array is considered.
> Parameters:
>   `value` - float[]

### setParameterValue

    public void setParameterValue(int n,
                                  int value)

> Sets the parameter value when the type is int.
> Parameters:

### setParameterValue

    public void setParameterValue(int n,
                                  int i,
                                  float value)

> Sets the ith value for the parameter (only valid for vec or mat types).
> Parameters:
>   `value` - float

### setParameterValue

    public void setParameterValue(int n,
                                  int i,
                                  int j,
                                  float value)

> Sets the (ith, jth) value for the parameter (only valid for mat types).
> Parameters:
>   `value` - float

### setParameterValues

    public void setParameterValues(float[] ...values)

> Sets all the value for all the parameters, by means of a parameter list of variable length. values is an array of float[].
> Parameters:

### setTextures

    public void setTextures(GLTexture[] textures)

### setVertexAttribs

    public void setVertexAttribs(int[] attribVBO,
                                 String[] attribName,
                                 int[] attribSize)

### start

    public void start()

### stop

    public void stop()

processing library glgraphics by Andres Colubri. (c) 2008