Package cz.fidentis.analyst.rendering
Class ShadersManager
java.lang.Object
cz.fidentis.analyst.rendering.ShadersManager
Handles GLSL
Program
s for 3D scene.
This class links shaders into a program, initialises buffers and textures, and uses programs during
a rendering pass.-
Constructor Summary
ConstructorsConstructorDescriptionShadersManager
(com.jogamp.opengl.GLContext glContext, com.jogamp.opengl.glu.GLU glu) Setups buffers and textures. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 typevoid
setUseContours
(boolean useContours) Setter for turning contours on and offvoid
setUseGlyphs
(boolean useGlyphs) Setter for turning glyphs on and off
-
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 benull
, must be at least GL2glu
- An OpenGL utilities. Must not benull
- 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 renderedviewPortWidth
- current width of the viewportviewPortHeight
- current height of the viewportlightPosition
- 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
-