Class GLSLProgram
java.lang.Object
org.jzy3d.io.glsl.GLSLProgram
Below is description of the GLSL program lifecycle, with Jzy3d methods, and underlying OpenGL
methods.
- load shaders with
and
invalid reference
attachVertexShader()invalid reference
attachFragmentShader()- glCreateShader
- glShaderSource
- glCompileShader
- glGetShaderiv (verify status)
- glGetShaderInfoLog (log errors)
- link(painter) links the compiled shaders
- glCreateProgram
- glAttachShader
- glLinkProgram
- glGetProgramiv (verify status)
- glGetProgramInfoLog (log errors)
- glValidateProgram
- bind(painter) mount the program @ rendering
- glUseProgram
-
invalid reference
bindTextureRECT(painter) - unbind(painter) unmount the program @ rendering
- glUseProgram(0)
- destroy(painter)
- glDeleteShader
- glDeleteProgram
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumControl the behaviour of a GLSL program with errors (throwing exceptions, create warnings, etc) -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic GLSLProgram.Strictnessprotected static org.slf4j.Loggerprotected Integerprotected GLSLProgram.Strictnessstatic booleanprotected StringBuffer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbindTexture(IPainter painter, int target, String texname, int texid, int texunit) voidbindTexture2D(IPainter painter, String texname, int texid, int texunit) voidbindTexture3D(IPainter painter, String texname, int texid, int texunit) voidbindTextureRECT(IPainter painter, String texname, int texid, int texunit) protected voidcheckShaderLogInfo(IPainter painter, int programObjectID) read logs and either throw exception, print to console or append to error log according to the configuredGLSLProgram.StrictnessvoidcompileFragmentShader(IPainter painter, URL infoURL, String content) voidcompileVertexShader(IPainter painter, URL infoURL, String content) voidvoidvoidCreate a program and attach previously loaded and compiled shaders.voidloadAndCompileFragmentShader(IPainter painter, InputStream stream) voidloadAndCompileFragmentShader(IPainter painter, InputStream stream, URL infoURL) voidloadAndCompileFragmentShader(IPainter painter, URL fileURL) voidloadAndCompileShaders(IPainter painter, ShaderFilePair files) voidloadAndCompileVertexShader(IPainter painter, InputStream stream) voidloadAndCompileVertexShader(IPainter painter, InputStream stream, URL infoURL) voidloadAndCompileVertexShader(IPainter painter, URL fileURL) readErrors(IPainter painter, int iID) readProgramErrors(IPainter painter, int programId) voidsetTextureUnit(IPainter painter, String texname, int texunit) voidsetUniform(IPainter painter, String name, float value) voidsetUniform(IPainter painter, String name, float[] values, int count) voidvoidvalidateProgram(IPainter painter) voidverifyLinkStatus(IPainter painter, int programId) voidverifyShaderCompiled(IPainter painter, URL fileURL, int programId, String content) protected voidwarn(String info, GLSLProgram.GLSLWarnType type) protected voidprotected voidwarnScript(IPainter painter, URL fileURL, String error, int compileStatus, int logLength, String content)
-
Field Details
-
DEFAULT_STRICTNESS
-
WARN_SHOW_SHADER_SOURCE
public static boolean WARN_SHOW_SHADER_SOURCE -
log
protected static org.slf4j.Logger log -
programId
-
vertexShaders_
-
fragmentShaders_
-
warnBuffer
-
strictness
-
-
Constructor Details
-
GLSLProgram
public GLSLProgram() -
GLSLProgram
-
-
Method Details
-
link
-
link
Create a program and attach previously loaded and compiled shaders. Performs validation and warn according to program strictness. -
bind
-
unbind
-
destroy
-
setUniform
-
setUniform
-
setTextureUnit
-
bindTexture
-
bindTexture2D
-
bindTexture3D
-
bindTextureRECT
-
loadAndCompileShaders
-
loadAndCompileVertexShader
-
loadAndCompileVertexShader
-
loadAndCompileVertexShader
- Parameters:
painter-stream- shader source code ressourceinfoURL- only used as information for warnings if shader does not compile properly
-
loadAndCompileFragmentShader
-
loadAndCompileFragmentShader
-
loadAndCompileFragmentShader
-
compileVertexShader
-
compileFragmentShader
-
verifyShaderCompiled
-
verifyLinkStatus
-
readErrors
-
readProgramErrors
-
validateProgram
-
checkShaderLogInfo
read logs and either throw exception, print to console or append to error log according to the configuredGLSLProgram.Strictness -
warnScript
-
warnLink
-
warn
-
getProgramId
-