Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## codeanticode.glgraphics
Class GLGraphicsOffScreen

    java.lang.Object
      PGraphicsOpenGL
          codeanticode.glgraphics.GLGraphicsOffScreen

All Implemented Interfaces:
  GLConstants

    public class GLGraphicsOffScreen

extends PGraphicsOpenGL
implements GLConstants

This class implements an opengl renderer for off-screen rendering to texture.

Nested Class Summary

Nested classes/interfaces inherited from interface codeanticode.glgraphics.GLConstants
`GLConstants.ClickAction, GLConstants.KeyboardAction, GLConstants.MouseAction, GLConstants.MouseHandler`

Field Summary
`float` | `currentLightFalloffConstantGL` Current light falloff
`float` | `currentLightFalloffLinearGL`
`float` | `currentLightFalloffQuadraticGL`
`float[]` | `currentLightSpecularGL` Current specular color for lighting
`int` | `lightCountGL`
`float[][]` | `lightDiffuseGL` Diffuse colors for lights.
`float[]` | `lightFalloffConstantGL` Light falloff
`float[]` | `lightFalloffLinearGL`
`float[]` | `lightFalloffQuadraticGL`
`float[][]` | `lightNormalGL` Light direction (normalized vector)
`float[][]` | `lightPositionGL` Light positions
`float[][]` | `lightSpecularGL` Specular colors for lights.
`float[]` | `lightSpotAngleCosGL` Cosine of light spot angle
`float[]` | `lightSpotAngleGL` Light spot angle
`float[]` | `lightSpotConcentrationGL` Light spot concentration
`int[]` | `lightTypeGL` Light types
`static int` | `MAX_LIGHTS_GL` Maximum lights by default is 8, the minimum defined by OpenGL.
`int` | `saveLightCount`
`float[]` | `zeroBufferGL`

Fields inherited from interface codeanticode.glgraphics.GLConstants
`BACKGROUND_ALPHA, COLOR, DOUBLE, FLOAT, GL_DEPTH_STENCIL, GL_DEPTH24_STENCIL8, GL_UNSIGNED_INT_24_8, GLGRAPHICS, LINE_LOOP, LINE_STRIP, LINEAR, LINEAR_MIPMAP_LINEAR, LINEAR_MIPMAP_NEAREST, NEAREST, NEAREST_MIPMAP_LINEAR, NEAREST_MIPMAP_NEAREST, POINT_SPRITES, TEX_BYTE, TEX_FILTER_PARAM_FLOAT, TEX_FILTER_PARAM_INT, TEX_FILTER_PARAM_MAT2, TEX_FILTER_PARAM_MAT3, TEX_FILTER_PARAM_MAT4, TEX_FILTER_PARAM_VEC2, TEX_FILTER_PARAM_VEC3, TEX_FILTER_PARAM_VEC4, TEX_INT, TEX_NORM, TEX_ONEDIM, TEX_RECT`

Constructor Summary
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight)` Creates an instance of GLGraphicsOffScreen with specified size, with mulisampling disabled.
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight, boolean multi)` Creates an instance of GLGraphicsOffScreen with specified size and enabled/disabled multisampling, according to the value of the argument multi.
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight, boolean multi, int level)` Creates an instance of GLGraphicsOffScreen with specified size and enabled/disabled multisampling and multisampling level, according to the values of the arguments multi and level.
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight, GLTextureParameters params)` Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture.
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight, GLTextureParameters params, boolean multi)` Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture.
`GLGraphicsOffScreen(processing.core.PApplet parent, int iwidth, int iheight, GLTextureParameters params, boolean multi, int level)` Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture.

Method Summary
`void` | `ambientLight(float r, float g, float b)` Add an ambient light based on the current color mode.
`void` | `ambientLight(float r, float g, float b, float x, float y, float z)` Add an ambient light based on the current color mode.
`void` | `beginDraw()` Any drawing operation with this rendered must be enclosed between a call to beginDraw() and endDraw().
`GL` | `beginGL()`
`void` | `camera()`
`void` | `camera(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, float centerZ, float upX, float upY, float upZ)`
`void` | `clear(float gray)`
`void` | `clear(float gray, float alpha)`
`void` | `clear(float x, float y, float z)`
`void` | `clear(float x, float y, float z, float a)`
`void` | `clear(int gray)`
`void` | `clear(int rgb, float alpha)`
`void` | `clear(int gray, int alpha)`
`void` | `clear(int x, int y, int z)`
`void` | `clear(int x, int y, int z, int a)`
`void` | `directionalLight(float r, float g, float b, float nx, float ny, float nz)`
`void` | `endCamera()`
`void` | `endDraw()` Any drawing operation with this rendered must be enclosed between a call to beginDraw() and endDraw().
`void` | `endGL()`
`void` | `frustum(float left, float right, float bottom, float top, float near, float far)`
`GLCapabilities` | `getCapabilities()` Returns the OpenGL capabilities of the drawable associated to this renderer.
`GLTexture` | `getTexture()` Returns the texture where this offscreen renderer draws to.
`void` | `lightFalloff(float constant, float linear, float quadratic)` Set the light falloff rates for the last light that was created.
`void` | `lights()`
`void` | `lightSpecular(float x, float y, float z)` Set the specular color of the last light created.
`void` | `model(GLModel model)`
`void` | `model(GLModel model, GLModelEffect effect)`
`void` | `model(GLModel model, int first, int last)`
`void` | `model(GLModel model, int first, int last, GLModelEffect effect)`
`void` | `noLights()`
`void` | `ortho()`
`void` | `ortho(float left, float right, float bottom, float top, float near, float far)`
`void` | `perspective()`
`void` | `perspective(float fov, float aspect, float near, float far)`
`void` | `pointLight(float r, float g, float b, float x, float y, float z)`
`void` | `popMatrix()`
`void` | `pushMatrix()`
`void` | `resetLights()`
`void` | `restoreLights()`
`void` | `rotate(float angle)`
`void` | `rotate(float angle, float vx, float vy, float vz)`
`void` | `rotateX(float angle)`
`void` | `rotateY(float angle)`
`void` | `rotateZ(float angle)`
`void` | `saveLights()`
`void` | `scale(float s)`
`void` | `scale(float sx, float sy)`
`void` | `scale(float x, float y, float z)`
`void` | `setBlendMode(int MODE)`
`void` | `setSize(int iwidth, int iheight)`
`void` | `shareContext(GLCanvas canvas)` Creates a new context for canvas that is shared with the context of GLGraphics.
`void` | `shareContext(GLDrawable drawable)` Creates a new context for drawable that is shared with the context of GLGraphics.
`void` | `spotLight(float r, float g, float b, float x, float y, float z, float nx, float ny, float nz, float angle, float concentration)`
`void` | `translate(float tx, float ty)`
`void` | `translate(float tx, float ty, float tz)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### MAX_LIGHTS_GL

    public static final int MAX_LIGHTS_GL

  Maximum lights by default is 8, the minimum defined by OpenGL.

  See Also:
    Constant Field Values

### lightCountGL

    public int lightCountGL

### lightTypeGL

    public int[] lightTypeGL

  Light types

### lightPositionGL

    public float[][] lightPositionGL

  Light positions

### lightNormalGL

    public float[][] lightNormalGL

  Light direction (normalized vector)

### lightFalloffConstantGL

    public float[] lightFalloffConstantGL

  Light falloff

### lightFalloffLinearGL

    public float[] lightFalloffLinearGL

### lightFalloffQuadraticGL

    public float[] lightFalloffQuadraticGL

### lightSpotAngleGL

    public float[] lightSpotAngleGL

  Light spot angle

### lightSpotAngleCosGL

    public float[] lightSpotAngleCosGL

  Cosine of light spot angle

### lightSpotConcentrationGL

    public float[] lightSpotConcentrationGL

  Light spot concentration

### lightDiffuseGL

    public float[][] lightDiffuseGL

  Diffuse colors for lights. For an ambient light, this will hold the ambient color. Internally these are stored as numbers between 0 and 1.

### lightSpecularGL

    public float[][] lightSpecularGL

  Specular colors for lights. Internally these are stored as numbers between 0 and 1.

### currentLightSpecularGL

    public float[] currentLightSpecularGL

  Current specular color for lighting

### currentLightFalloffConstantGL

    public float currentLightFalloffConstantGL

  Current light falloff

### currentLightFalloffLinearGL

    public float currentLightFalloffLinearGL

### currentLightFalloffQuadraticGL

    public float currentLightFalloffQuadraticGL

### zeroBufferGL

    public float[] zeroBufferGL

### saveLightCount

    public int saveLightCount

Constructor Detail

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight)

  Creates an instance of GLGraphicsOffScreen with specified size, with mulisampling disabled.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight,
                               boolean multi)

  Creates an instance of GLGraphicsOffScreen with specified size and enabled/disabled multisampling, according to the value of the argument multi. If multisampling is enabled the multisampling level is set by default to 4x.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int
    `multi` - int

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight,
                               boolean multi,
                               int level)

  Creates an instance of GLGraphicsOffScreen with specified size and enabled/disabled multisampling and multisampling level, according to the values of the arguments multi and level.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int
    `multi` - int
    `level` - int

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight,
                               GLTextureParameters params)

  Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture. Multisampling is disabled.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int
    `params` - GLTextureParameters

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight,
                               GLTextureParameters params,
                               boolean multi)

  Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture. Multisampling is enabled/disabled according to the value of the argument multi. If multisampling is enabled, the multisampling level is set by default to 4x.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int
    `params` - GLTextureParameters
    `multi` - int

### GLGraphicsOffScreen

    public GLGraphicsOffScreen(processing.core.PApplet parent,
                               int iwidth,
                               int iheight,
                               GLTextureParameters params,
                               boolean multi,
                               int level)

  Creates an instance of GLGraphicsOffScreen with specified size and parameters for the destination texture. Multisampling is enabled/disabled according to the value of the argument multi, and its level is contolled by the argument level.

  Parameters:
    `parent` - PApplet
    `iwidth` - int
    `iheight` - int
    `params` - GLTextureParameters
    `multi` - int
    `level` - int

Method Detail

### setSize

    public void setSize(int iwidth,
                        int iheight)

### getTexture

    public GLTexture getTexture()

  Returns the texture where this offscreen renderer draws to.

  Returns:
    GLTexture

### getCapabilities

    public GLCapabilities getCapabilities()

  Returns the OpenGL capabilities of the drawable associated to this renderer.

  Returns:
    GLCapabilities

### shareContext

    public void shareContext(GLCanvas canvas)

  Creates a new context for canvas that is shared with the context of GLGraphics.

  Parameters:
    `GLCanvas` - canvas

### shareContext

    public void shareContext(GLDrawable drawable)

  Creates a new context for drawable that is shared with the context of GLGraphics.

  Parameters:
    `GLDrawable` - drawable

### beginGL

    public GL beginGL()

### endGL

    public void endGL()

### beginDraw

    public void beginDraw()

  Any drawing operation with this rendered must be enclosed between a call to beginDraw() and endDraw().

### endDraw

    public void endDraw()

  Any drawing operation with this rendered must be enclosed between a call to beginDraw() and endDraw().

### pushMatrix

    public void pushMatrix()

### popMatrix

    public void popMatrix()

### translate

    public void translate(float tx,
                          float ty)

### translate

    public void translate(float tx,
                          float ty,
                          float tz)

### rotate

    public void rotate(float angle)

### rotateX

    public void rotateX(float angle)

### rotateY

    public void rotateY(float angle)

### rotateZ

    public void rotateZ(float angle)

### rotate

    public void rotate(float angle,
                       float vx,
                       float vy,
                       float vz)

### scale

    public void scale(float s)

### scale

    public void scale(float sx,
                      float sy)

### scale

    public void scale(float x,
                      float y,
                      float z)

### lights

    public void lights()

### saveLights

    public void saveLights()

### restoreLights

    public void restoreLights()

### resetLights

    public void resetLights()

### noLights

    public void noLights()

### ambientLight

    public void ambientLight(float r,
                             float g,
                             float b)

  Add an ambient light based on the current color mode.

### ambientLight

    public void ambientLight(float r,
                             float g,
                             float b,
                             float x,
                             float y,
                             float z)

  Add an ambient light based on the current color mode. This version includes an (x, y, z) position for situations where the falloff distance is used.

### directionalLight

    public void directionalLight(float r,
                                 float g,
                                 float b,
                                 float nx,
                                 float ny,
                                 float nz)

### pointLight

    public void pointLight(float r,
                           float g,
                           float b,
                           float x,
                           float y,
                           float z)

### spotLight

    public void spotLight(float r,
                          float g,
                          float b,
                          float x,
                          float y,
                          float z,
                          float nx,
                          float ny,
                          float nz,
                          float angle,
                          float concentration)

### lightFalloff

    public void lightFalloff(float constant,
                             float linear,
                             float quadratic)

  Set the light falloff rates for the last light that was created. Default is lightFalloff(1, 0, 0).

### lightSpecular

    public void lightSpecular(float x,
                              float y,
                              float z)

  Set the specular color of the last light created.

### endCamera

    public void endCamera()

### camera

    public void camera()

### camera

    public void camera(float eyeX,
                       float eyeY,
                       float eyeZ,
                       float centerX,
                       float centerY,
                       float centerZ,
                       float upX,
                       float upY,
                       float upZ)

### ortho

    public void ortho()

### ortho

    public void ortho(float left,
                      float right,
                      float bottom,
                      float top,
                      float near,
                      float far)

### perspective

    public void perspective()

### perspective

    public void perspective(float fov,
                            float aspect,
                            float near,
                            float far)

### frustum

    public void frustum(float left,
                        float right,
                        float bottom,
                        float top,
                        float near,
                        float far)

### model

    public void model(GLModel model)

### model

    public void model(GLModel model,
                      GLModelEffect effect)

### model

    public void model(GLModel model,
                      int first,
                      int last)

### model

    public void model(GLModel model,
                      int first,
                      int last,
                      GLModelEffect effect)

### clear

    public void clear(int gray)

### clear

    public void clear(float gray)

### clear

    public void clear(int gray,
                      int alpha)

### clear

    public void clear(int rgb,
                      float alpha)

### clear

    public void clear(float gray,
                      float alpha)

### clear

    public void clear(int x,
                      int y,
                      int z)

### clear

    public void clear(float x,
                      float y,
                      float z)

### clear

    public void clear(int x,
                      int y,
                      int z,
                      int a)

### clear

    public void clear(float x,
                      float y,
                      float z,
                      float a)

### setBlendMode

    public void setBlendMode(int MODE)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

processing library glgraphics by Andres Colubri. (c) 2008