Convenient shader code class to use and instantiate vertex or fragment programs.
More...
|
| | ShaderCode (final int type, final int count, final CharSequence[][] source) |
| |
| | ShaderCode (final int type, final int count, final int binFormat, final Buffer binary) |
| |
| int | id () |
| | returns the uniq shader id as an integer More...
|
| |
| int | shaderType () |
| |
| String | shaderTypeStr () |
| |
| int | shaderBinaryFormat () |
| |
| Buffer | shaderBinary () |
| |
| CharSequence[][] | shaderSource () |
| |
| boolean | isValid () |
| |
| IntBuffer | shader () |
| |
| boolean | compile (final GL2ES2 gl) |
| |
| boolean | compile (final GL2ES2 gl, final PrintStream verboseOut) |
| |
| void | destroy (final GL2ES2 gl) |
| |
| boolean | equals (final Object obj) |
| |
| int | hashCode () |
| |
| String | toString () |
| |
| void | dumpSource (final PrintStream out) |
| |
| int | insertShaderSource (final int shaderIdx, final String tag, final int fromIndex, final CharSequence data) |
| | Adds data after the line containing tag. More...
|
| |
| int | replaceInShaderSource (final String oldName, final String newName) |
| | Replaces oldName with newName in all shader sources. More...
|
| |
| int | insertShaderSource (final int shaderIdx, int position, final CharSequence data) |
| | Adds data at position in shader source for shader shaderIdx. More...
|
| |
| int | insertShaderSource (final int shaderIdx, final int position, final Class<?> context, final String path) throws IOException |
| | Adds shader source located in path, either relative to the context class or absolute as-is at position in shader source for shader shaderIdx. More...
|
| |
| final int | addGLSLVersion (final GL2ES2 gl) |
| | Add GLSL version at the head of this shader source code. More...
|
| |
| final int | addDefaultShaderPrecision (final GL2ES2 gl, int pos) |
| | Adds default precision to source code at given position if required, i.e. More...
|
| |
| final int | defaultShaderCustomization (final GL2ES2 gl, final boolean preludeVersion, final boolean addDefaultPrecision) |
| | Default customization of this shader source code. More...
|
| |
| final int | defaultShaderCustomization (final GL2ES2 gl, final boolean preludeVersion, final String esDefaultPrecision) |
| | Default customization of this shader source code. More...
|
| |
|
| static ShaderCode | create (final GL2ES2 gl, final int type, final int count, final Class<?> context, final String[] sourceFiles, final boolean mutableStringBuilder) |
| | Creates a complete ShaderCode object while reading all shader source of sourceFiles, which location is resolved using the context class, see readShaderSource(Class, String). More...
|
| |
| static ShaderCode | create (final GL2ES2 gl, final int type, final int count, final Uri[] sourceLocations, final boolean mutableStringBuilder) |
| | Creates a complete ShaderCode object while reading all shader sources from Uri sourceLocations via readShaderSource(Uri, boolean). More...
|
| |
| static ShaderCode | create (final int type, final int count, final Class<?> context, int binFormat, final String binaryFile) |
| | Creates a complete ShaderCode object while reading the shader binary of binaryFile, which location is resolved using the context class, see readShaderBinary(Class, String). More...
|
| |
| static ShaderCode | create (final int type, final int count, int binFormat, final Uri binLocation) |
| | Creates a complete ShaderCode object while reading the shader binary from Uri binLocations via readShaderBinary(Uri). More...
|
| |
| static String | getFileSuffix (final boolean binary, final int type) |
| | Returns a unique suffix for shader resources as follows: More...
|
| |
| static String | getBinarySubPath (final int binFormat) |
| | Returns a unique relative path for binary shader resources as follows: More...
|
| |
| static ShaderCode | create (final GL2ES2 gl, final int type, final int count, final Class<?> context, final String srcRoot, final String[] srcBasenames, final String srcSuffixOpt, final String binRoot, final String binBasename, final String binSuffixOpt, final boolean mutableStringBuilder) |
| | Convenient creation method for instantiating a complete ShaderCode object either from source code using create(GL2ES2, int, int, Class, String[]), or from a binary code using create(int, int, Class, int, String), whatever is available first. More...
|
| |
| static ShaderCode | create (final GL2ES2 gl, final int type, final int count, final Class<?> context, final String srcRoot, final String[] srcBasenames, final String binRoot, final String binBasename, final boolean mutableStringBuilder) |
| | Simplified variation of create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean). More...
|
| |
| static ShaderCode | create (final GL2ES2 gl, final int type, final Class<?> context, final String srcRoot, final String binRoot, final String basename, final String srcSuffixOpt, final String binSuffixOpt, final boolean mutableStringBuilder) |
| | Simplified variation of create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean). More...
|
| |
| static ShaderCode | create (final GL2ES2 gl, final int type, final Class<?> context, final String srcRoot, final String binRoot, final String basename, final boolean mutableStringBuilder) |
| | Simplified variation of create(GL2ES2, int, Class, String, String, String, String, String, boolean). More...
|
| |
| static String | shaderTypeStr (final int type) |
| |
| static void | readShaderSource (final Class<?> context, final URLConnection conn, final StringBuilder result) throws IOException |
| | Reads shader source located in conn. More...
|
| |
| static CharSequence | readShaderSource (final Class<?> context, final String path, final boolean mutableStringBuilder) throws IOException |
| | Reads shader source located in path, either relative to the context class or absolute as-is. More...
|
| |
| static CharSequence | readShaderSource (final Uri sourceLocation, final boolean mutableStringBuilder) throws IOException |
| | Reads shader source located from Uri#absolute Uri sourceLocation. More...
|
| |
| static ByteBuffer | readShaderBinary (final Class<?> context, final String path) throws IOException |
| | Reads shader binary located in path, either relative to the context class or absolute as-is. More...
|
| |
| static ByteBuffer | readShaderBinary (final Uri binLocation) throws IOException |
| | Reads shader binary located from Uri#absolute Uri binLocation. More...
|
| |
| static String | createExtensionDirective (final String extensionName, final String behavior) |
| | Creates a GLSL extension directive. More...
|
| |
| static final boolean | requiresDefaultPrecision (final GL2ES2 gl) |
| | Returns true, if GLSL version requires default precision, i.e. More...
|
| |
| static final boolean | requiresGL3DefaultPrecision (final GL2ES2 gl) |
| | Returns true, if GL3 GLSL version requires default precision, i.e. More...
|
| |
|
| static final boolean | DEBUG_CODE = Debug.isPropertyDefined("jogl.debug.GLSLCode", true) |
| |
| static final String | SUFFIX_VERTEX_SOURCE = "vp" |
| | Unique resource suffix for GL2ES2#GL_VERTEX_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_VERTEX_BINARY = "bvp" |
| | Unique resource suffix for GL2ES2#GL_VERTEX_SHADER in binary: {@value} More...
|
| |
| static final String | SUFFIX_GEOMETRY_SOURCE = "gp" |
| | Unique resource suffix for GL3#GL_GEOMETRY_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_GEOMETRY_BINARY = "bgp" |
| | Unique resource suffix for GL3#GL_GEOMETRY_SHADER in binary: {@value} More...
|
| |
| static final String | SUFFIX_COMPUTE_SOURCE = "cp" |
| | Unique resource suffix for GL3ES3#GL_COMPUTE_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_COMPUTE_BINARY = "bcp" |
| | Unique resource suffix for GL3ES3#GL_COMPUTE_SHADER in binary: {@value} More...
|
| |
| static final String | SUFFIX_TESS_CONTROL_SOURCE = "tcp" |
| | Unique resource suffix for GL4#GL_TESS_CONTROL_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_TESS_CONTROL_BINARY = "btcp" |
| | Unique resource suffix for GL4#GL_TESS_CONTROL_SHADER in binary: {@value} More...
|
| |
| static final String | SUFFIX_TESS_EVALUATION_SOURCE = "tep" |
| | Unique resource suffix for GL4#GL_TESS_EVALUATION_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_TESS_EVALUATION_BINARY = "btep" |
| | Unique resource suffix for GL4#GL_TESS_EVALUATION_SHADER in binary: {@value} More...
|
| |
| static final String | SUFFIX_FRAGMENT_SOURCE = "fp" |
| | Unique resource suffix for GL2ES2#GL_FRAGMENT_SHADER in source code: {@value} More...
|
| |
| static final String | SUFFIX_FRAGMENT_BINARY = "bfp" |
| | Unique resource suffix for GL2ES2#GL_FRAGMENT_SHADER in binary: {@value} More...
|
| |
| static final String | SUB_PATH_NVIDIA = "nvidia" |
| | Unique relative path for binary shader resources for NVIDIA: {@value} More...
|
| |
| static final String | es2_default_precision_vp = "\nprecision highp float;\nprecision highp int;\n/*precision lowp sampler2D;*/\n/*precision lowp samplerCube;*/\n" |
| | Default precision of ES2 for vertex-shader: {@value es2_default_precision_vp}. More...
|
| |
| static final String | es2_default_precision_fp = "\nprecision mediump float;\nprecision mediump int;\n/*precision lowp sampler2D;*/\n/*precision lowp samplerCube;*/\n" |
| | Default precision of ES2 for fragment-shader: {@value es2_default_precision_fp}. More...
|
| |
| static final String | es3_default_precision_vp = es2_default_precision_vp |
| | Default precision of ES3 for vertex-shader: {@value es3_default_precision_vp}. More...
|
| |
| static final String | es3_default_precision_fp = es3_default_precision_vp |
| | Default precision of ES3 for fragment-shader: {@value es3_default_precision_fp}, same as for vertex-shader, i.e es3_default_precision_vp, due to ES 3.x requirements of using same precision for uniforms! More...
|
| |
| static final String | gl3_default_precision_vp_gp = "\nprecision highp float;\nprecision highp int;\n" |
| | Default precision of GLSL ≥ 1.30 as required until < 1.50 for vertex-shader or geometry-shader: {@value gl3_default_precision_vp_gp}. More...
|
| |
| static final String | gl3_default_precision_fp = "\nprecision highp float;\nprecision mediump int;\n/*precision mediump sampler2D;*/\n" |
| | Default precision of GLSL ≥ 1.30 as required until < 1.50 for fragment-shader: {@value gl3_default_precision_fp}. More...
|
| |
| static final String | REQUIRE = "require" |
| | Behavior for GLSL extension directive, see createExtensionDirective(String, String), value {@value}. More...
|
| |
| static final String | ENABLE = "enable" |
| | Behavior for GLSL extension directive, see createExtensionDirective(String, String), value {@value}. More...
|
| |
| static final String | DISABLE = "disable" |
| | Behavior for GLSL extension directive, see createExtensionDirective(String, String), value {@value}. More...
|
| |
| static final String | WARN = "warn" |
| | Behavior for GLSL extension directive, see createExtensionDirective(String, String), value {@value}. More...
|
| |
Convenient shader code class to use and instantiate vertex or fragment programs.
A documented example of how to use this code is available here and here.
Support for GL4#GL_TESS_CONTROL_SHADER and GL4#GL_TESS_EVALUATION_SHADER was added since 2.2.1.
Definition at line 75 of file ShaderCode.java.
| static ShaderCode com.jogamp.opengl.util.glsl.ShaderCode.create |
( |
final GL2ES2 |
gl, |
|
|
final int |
type, |
|
|
final Class<?> |
context, |
|
|
final String |
srcRoot, |
|
|
final String |
binRoot, |
|
|
final String |
basename, |
|
|
final boolean |
mutableStringBuilder |
|
) |
| |
|
static |
Simplified variation of create(GL2ES2, int, Class, String, String, String, String, String, boolean).
Example:
Your std JVM layout (plain or within a JAR):
org/test/glsl/MyShaderTest.class
org/test/glsl/shader/vertex.vp
org/test/glsl/shader/fragment.fp
org/test/glsl/shader/bin/nvidia/vertex.bvp
org/test/glsl/shader/bin/nvidia/fragment.bfp
Your Android APK layout:
classes.dex
assets/org/test/glsl/shader/vertex.vp
assets/org/test/glsl/shader/fragment.fp
assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
...
Your invocation in org/test/glsl/MyShaderTest.java:
ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
"shader", "shader/bin", "vertex", true);
ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
"shader", "shader/bin", "fragment", true);
ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
- Parameters
-
| gl | current GL object to determine whether a shader compiler is available (if source is used), or to determine the shader binary format (if binary is used). |
| type | either GL2ES2#GL_VERTEX_SHADER, GL2ES2#GL_FRAGMENT_SHADER, GL3#GL_GEOMETRY_SHADER, GL4#GL_TESS_CONTROL_SHADER, GL4#GL_TESS_EVALUATION_SHADER or GL3ES3#GL_COMPUTE_SHADER. |
| context | class used to help resolving the source and binary location |
| srcRoot | relative root path for basename optional |
| binRoot | relative root path for basename |
| mutableStringBuilder | if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to GL2ES2#glShaderSource(int, int, String[], IntBuffer). If false method returns an immutable String instance, which can be passed to GL2ES2#glShaderSource(int, int, String[], IntBuffer) at no additional costs. |
| basenames | basename w/o path or suffix relative to srcRoot and binRoot for the shader's source and binary code. |
| mutableStringBuilder | if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to GL2ES2#glShaderSource(int, int, String[], IntBuffer). If false method returns an immutable String instance, which can be passed to GL2ES2#glShaderSource(int, int, String[], IntBuffer) at no additional costs. |
- Exceptions
-
| IllegalArgumentException | if count is not 1 |
Definition at line 768 of file ShaderCode.java.
| static ShaderCode com.jogamp.opengl.util.glsl.ShaderCode.create |
( |
final GL2ES2 |
gl, |
|
|
final int |
type, |
|
|
final Class<?> |
context, |
|
|
final String |
srcRoot, |
|
|
final String |
binRoot, |
|
|
final String |
basename, |
|
|
final String |
srcSuffixOpt, |
|
|
final String |
binSuffixOpt, |
|
|
final boolean |
mutableStringBuilder |
|
) |
| |
|
static |
Simplified variation of create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean).
Example:
Your std JVM layout (plain or within a JAR):
org/test/glsl/MyShaderTest.class
org/test/glsl/shader/vertex.vp
org/test/glsl/shader/fragment.fp
org/test/glsl/shader/bin/nvidia/vertex.bvp
org/test/glsl/shader/bin/nvidia/fragment.bfp
Your Android APK layout:
classes.dex
assets/org/test/glsl/shader/vertex.vp
assets/org/test/glsl/shader/fragment.fp
assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
...
Your invocation in org/test/glsl/MyShaderTest.java:
ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
"shader", "shader/bin", "vertex", null, null, true);
ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
"shader", "shader/bin", "fragment", null, null, true);
ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
- Parameters
-
| gl | current GL object to determine whether a shader compiler is available (if source is used), or to determine the shader binary format (if binary is used). |
| type | either GL2ES2#GL_VERTEX_SHADER, GL2ES2#GL_FRAGMENT_SHADER, GL3#GL_GEOMETRY_SHADER, GL4#GL_TESS_CONTROL_SHADER, GL4#GL_TESS_EVALUATION_SHADER or GL3ES3#GL_COMPUTE_SHADER. |
| context | class used to help resolving the source and binary location |
| srcRoot | relative root path for basename optional |
| binRoot | relative root path for basename |
| basename | basename w/o path or suffix relative to srcRoot and binRoot for the shader's source and binary code. |
| srcSuffixOpt | optional custom suffix for shader's source file, if null getFileSuffix(boolean, int) is being used. |
| binSuffixOpt | optional custom suffix for shader's binary file, if null getFileSuffix(boolean, int) is being used. |
| mutableStringBuilder | if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to GL2ES2#glShaderSource(int, int, String[], IntBuffer). If false method returns an immutable String instance, which can be passed to GL2ES2#glShaderSource(int, int, String[], IntBuffer) at no additional costs. |
- Exceptions
-
| IllegalArgumentException | if count is not 1 |
- See also
- #create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean)
- Since
- 2.3.2
Definition at line 702 of file ShaderCode.java.
| static ShaderCode com.jogamp.opengl.util.glsl.ShaderCode.create |
( |
final GL2ES2 |
gl, |
|
|
final int |
type, |
|
|
final int |
count, |
|
|
final Class<?> |
context, |
|
|
final String |
srcRoot, |
|
|
final String[] |
srcBasenames, |
|
|
final String |
binRoot, |
|
|
final String |
binBasename, |
|
|
final boolean |
mutableStringBuilder |
|
) |
| |
|
static |
Simplified variation of create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean).
Convenient creation method for instantiating a complete ShaderCode object either from source code using create(GL2ES2, int, int, Class, String[]), or from a binary code using create(int, int, Class, int, String), whatever is available first.
The source and binary location names are expected w/o suffixes which are resolved and appended using getFileSuffix(boolean, int).
Additionally, the binary resource is expected within a subfolder of binRoot which reflects the vendor specific binary format, see getBinarySubPath(int). All ShaderUtil#getShaderBinaryFormats(GL) are being iterated using the binary subfolder, the first existing resource is being used.
Example:
Your std JVM layout (plain or within a JAR):
org/test/glsl/MyShaderTest.class
org/test/glsl/shader/vertex.vp
org/test/glsl/shader/fragment.fp
org/test/glsl/shader/bin/nvidia/vertex.bvp
org/test/glsl/shader/bin/nvidia/fragment.bfp
Your Android APK layout:
classes.dex
assets/org/test/glsl/shader/vertex.vp
assets/org/test/glsl/shader/fragment.fp
assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
...
Your invocation in org/test/glsl/MyShaderTest.java:
ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, 1, this.getClass(),
"shader", new String[] { "vertex" }, "shader/bin", "vertex", true);
ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, 1, this.getClass(),
"shader", new String[] { "vertex" }, "shader/bin", "fragment", true);
ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
A simplified entry point is create(GL2ES2, int, Class, String, String, String, boolean).
The location is finally being resolved using the context class, see readShaderBinary(Class, String).
- Parameters
-
| gl | current GL object to determine whether a shader compiler is available (if source is used), or to determine the shader binary format (if binary is used). |
| type | either GL2ES2#GL_VERTEX_SHADER, GL2ES2#GL_FRAGMENT_SHADER, GL3#GL_GEOMETRY_SHADER, GL4#GL_TESS_CONTROL_SHADER, GL4#GL_TESS_EVALUATION_SHADER or GL3ES3#GL_COMPUTE_SHADER. |
| count | number of shaders |
| context | class used to help resolving the source and binary location |
| srcRoot | relative root path for srcBasenames optional |
| srcBasenames | basenames w/o path or suffix relative to srcRoot for the shader's source code |
| binRoot | relative root path for binBasenames |
| binBasename | basename w/o path or suffix relative to binRoot for the shader's binary code |
| mutableStringBuilder | if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to GL2ES2#glShaderSource(int, int, String[], IntBuffer). If false method returns an immutable String instance, which can be passed to GL2ES2#glShaderSource(int, int, String[], IntBuffer) at no additional costs. |
- Exceptions
-
| IllegalArgumentException | if count and srcBasenames.length do not match |
- See also
- #create(GL2ES2, int, int, Class, String, String[], String, String, String, String, boolean)
-
#readShaderSource(Class, String)
-
getFileSuffix(boolean, int)
-
ShaderUtil::getShaderBinaryFormats(GL)
-
getBinarySubPath(int)
Definition at line 635 of file ShaderCode.java.
| static ShaderCode com.jogamp.opengl.util.glsl.ShaderCode.create |
( |
final GL2ES2 |
gl, |
|
|
final int |
type, |
|
|
final int |
count, |
|
|
final Class<?> |
context, |
|
|
final String |
srcRoot, |
|
|
final String[] |
srcBasenames, |
|
|
final String |
srcSuffixOpt, |
|
|
final String |
binRoot, |
|
|
final String |
binBasename, |
|
|
final String |
binSuffixOpt, |
|
|
final boolean |
mutableStringBuilder |
|
) |
| |
|
static |
Convenient creation method for instantiating a complete ShaderCode object either from source code using create(GL2ES2, int, int, Class, String[]), or from a binary code using create(int, int, Class, int, String), whatever is available first.
The source and binary location names are expected w/o suffixes which are resolved and appended using the given srcSuffixOpt and binSuffixOpt if not null, otherwise getFileSuffix(boolean, int) determines the suffixes.
Additionally, the binary resource is expected within a subfolder of binRoot which reflects the vendor specific binary format, see getBinarySubPath(int). All ShaderUtil#getShaderBinaryFormats(GL) are being iterated using the binary subfolder, the first existing resource is being used.
Example:
Your std JVM layout (plain or within a JAR):
org/test/glsl/MyShaderTest.class
org/test/glsl/shader/vertex.vp
org/test/glsl/shader/fragment.fp
org/test/glsl/shader/bin/nvidia/vertex.bvp
org/test/glsl/shader/bin/nvidia/fragment.bfp
Your Android APK layout:
classes.dex
assets/org/test/glsl/shader/vertex.vp
assets/org/test/glsl/shader/fragment.fp
assets/org/test/glsl/shader/bin/nvidia/vertex.bvp
assets/org/test/glsl/shader/bin/nvidia/fragment.bfp
...
Your invocation in org/test/glsl/MyShaderTest.java:
ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, 1, this.getClass(),
"shader", new String[] { "vertex" }, null,
"shader/bin", "vertex", null, true);
ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, 1, this.getClass(),
"shader", new String[] { "vertex" }, null,
"shader/bin", "fragment", null, true);
ShaderProgram sp0 = new ShaderProgram();
sp0.add(gl, vp0, System.err);
sp0.add(gl, fp0, System.err);
st.attachShaderProgram(gl, sp0, true);
A simplified entry point is create(GL2ES2, int, Class, String, String, String, boolean).
The location is finally being resolved using the context class, see readShaderBinary(Class, String).
- Parameters
-
| gl | current GL object to determine whether a shader compiler is available (if source is used), or to determine the shader binary format (if binary is used). |
| type | either GL2ES2#GL_VERTEX_SHADER, GL2ES2#GL_FRAGMENT_SHADER, GL3#GL_GEOMETRY_SHADER, GL4#GL_TESS_CONTROL_SHADER, GL4#GL_TESS_EVALUATION_SHADER or GL3ES3#GL_COMPUTE_SHADER. |
| count | number of shaders |
| context | class used to help resolving the source and binary location |
| srcRoot | relative root path for srcBasenames optional |
| srcBasenames | basenames w/o path or suffix relative to srcRoot for the shader's source code |
| srcSuffixOpt | optional custom suffix for shader's source file, if null getFileSuffix(boolean, int) is being used. |
| binRoot | relative root path for binBasenames |
| binBasename | basename w/o path or suffix relative to binRoot for the shader's binary code |
| binSuffixOpt | optional custom suffix for shader's binary file, if null getFileSuffix(boolean, int) is being used. |
| mutableStringBuilder | if true method returns a mutable StringBuilder instance which can be edited later on at the costs of a String conversion when passing to GL2ES2#glShaderSource(int, int, String[], IntBuffer). If false method returns an immutable String instance, which can be passed to GL2ES2#glShaderSource(int, int, String[], IntBuffer) at no additional costs. |
- Exceptions
-
| IllegalArgumentException | if count and srcBasenames.length do not match |
- See also
- #create(GL2ES2, int, int, Class, String[])
-
#create(int, int, Class, int, String)
-
#readShaderSource(Class, String)
-
getFileSuffix(boolean, int)
-
ShaderUtil::getShaderBinaryFormats(GL)
-
getBinarySubPath(int)
- Since
- 2.3.2
Definition at line 508 of file ShaderCode.java.