public final class R2ShaderParameters extends Object
Modifier and Type | Method and Description |
---|---|
static void |
checkUniformParameterCount(com.io7m.jcanephora.core.JCGLProgramShaderUsableType p,
int count)
Check that the given program has the expected number of uniform
parameters.
|
static boolean |
lightShaderTargetIsImageBuffer(Map<String,String> environment)
Determine if a given shader environment implies that the light shader to
which the environment belongs was compiled to write its output to an image
buffer instead of a light buffer.
|
static boolean |
lightShaderTargetIsLightBuffer(Map<String,String> environment)
Determine if a given shader environment implies that the light shader to
which the environment belongs was compiled to write its output to a light
buffer instead of an image buffer.
|
static com.io7m.jcanephora.core.JCGLProgramUniformType |
uniform(com.io7m.jcanephora.core.JCGLProgramShaderUsableType p,
String name,
com.io7m.jcanephora.core.JCGLType type)
Retrieve a uniform parameter for the given program, raising an exception if
the parameter is not present for any reason.
|
public static com.io7m.jcanephora.core.JCGLProgramUniformType uniform(com.io7m.jcanephora.core.JCGLProgramShaderUsableType p, String name, com.io7m.jcanephora.core.JCGLType type) throws R2ExceptionShaderParameterNotPresent
p
- The programname
- The parameter nametype
- The expected type of the parameterR2ExceptionShaderParameterNotPresent
- Iff the shader parameter was
either undeclared or was
optimized outpublic static void checkUniformParameterCount(com.io7m.jcanephora.core.JCGLProgramShaderUsableType p, int count) throws R2ExceptionShaderParameterCountMismatch
p
- The programcount
- The expected number of parametersR2ExceptionShaderParameterCountMismatch
- On unexpected parameter
countspublic static boolean lightShaderTargetIsImageBuffer(Map<String,String> environment)
environment
- The shader environment of the shadertrue
if the given shader is writing to an image bufferpublic static boolean lightShaderTargetIsLightBuffer(Map<String,String> environment)
environment
- The shader environment of the shadertrue
if the given shader is writing to a light bufferCopyright © 2017 <code@io7m.com> http://io7m.com