Class ShadersManager

java.lang.Object
cz.fidentis.analyst.rendering.ShadersManager

public class ShadersManager extends Object
Handles GLSL Programs for 3D scene. This class links shaders into a program, initialises buffers and textures, and uses programs during a rendering pass.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShadersManager(com.jogamp.opengl.GLContext glContext, com.jogamp.opengl.glu.GLU glu)
    Setups buffers and textures.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    renderObjects(Collection<Drawable> drawables, int viewPortWidth, int viewPortHeight, javax.vecmath.Vector4f lightPosition)
    Puts drawable objects through pipeline which enables to render fog simulation and contours.
    void
    setFogVersion(int fogVersion)
    Setter for fog rendering type
    void
    setUseContours(boolean useContours)
    Setter for turning contours on and off
    void
    setUseGlyphs(boolean useGlyphs)
    Setter for turning glyphs on and off

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShadersManager

      public ShadersManager(com.jogamp.opengl.GLContext glContext, com.jogamp.opengl.glu.GLU glu)
      Setups buffers and textures. To be used in the initialisation phase of the OpenGl context.
      Parameters:
      glContext - An OpenGL context. Must not be null, must be at least GL2
      glu - An OpenGL utilities. Must not be null
      Throws:
      com.jogamp.opengl.GLException - if the shaders' initiation fails
  • Method Details

    • renderObjects

      public void renderObjects(Collection<Drawable> drawables, int viewPortWidth, int viewPortHeight, javax.vecmath.Vector4f lightPosition)
      Puts drawable objects through pipeline which enables to render fog simulation and contours.
      Parameters:
      drawables - objects to be rendered
      viewPortWidth - current width of the viewport
      viewPortHeight - current height of the viewport
      lightPosition - the position of the scene's light in homogenous object coordinates.
    • setFogVersion

      public void setFogVersion(int fogVersion)
      Setter for fog rendering type
      Parameters:
      fogVersion - Enumerated type of fog
    • setUseContours

      public void setUseContours(boolean useContours)
      Setter for turning contours on and off
      Parameters:
      useContours - boolean to set the contours to
    • setUseGlyphs

      public void setUseGlyphs(boolean useGlyphs)
      Setter for turning glyphs on and off
      Parameters:
      useGlyphs - boolean to set the glyphs to