java.lang.Object
com.marginallyclever.ro3.shader.ShaderProgram
- All Implemented Interfaces:
OpenGL3Resource
ShaderProgram is a wrapper for shader programs made of several Shaders. It also provides a
simple interface for setting uniforms.
-
Method Summary
Modifier and TypeMethodDescriptionintintgetUniformLocation(com.jogamp.opengl.GL3 gl, String name) voidvoidvoidvoidvoidvoidvoidsetMatrix4d(com.jogamp.opengl.GL3 gl, String name, javax.vecmath.Matrix4d value) Set a matrix in the shader.voidsetVector3d(com.jogamp.opengl.GL3 gl, String name, javax.vecmath.Vector3d value) voidshowProgramError(com.jogamp.opengl.GL3 gl, String message) voidunload(com.jogamp.opengl.GL3 gl) voiduse(com.jogamp.opengl.GL3 gl)
-
Method Details
-
showProgramError
-
use
public void use(com.jogamp.opengl.GL3 gl) -
unload
public void unload(com.jogamp.opengl.GL3 gl) - Specified by:
unloadin interfaceOpenGL3Resource
-
getProgramId
public int getProgramId() -
getUniformLocation
-
set1f
-
set2f
-
set3f
-
set4f
-
setVector3d
-
setMatrix4d
Set a matrix in the shader. Java uses column-major order, where OpenGL and DirectX use row-major order. Thus the thurd parameter is true to make the video card transpose the matrix from row-major to column-major.- Parameters:
gl- the viewport contextname- the name of the uniform variablevalue- the matrix to set- See Also:
-
set1i
-
setColor
-