本文整理汇总了Java中com.jogamp.opengl.GL4.glGetActiveUniformName方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glGetActiveUniformName方法的具体用法?Java GL4.glGetActiveUniformName怎么用?Java GL4.glGetActiveUniformName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL4
的用法示例。
在下文中一共展示了GL4.glGetActiveUniformName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
gl4.glGenProgramPipelines(1, pipelineName);
ShaderProgram shaderProgram = new ShaderProgram();
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "frag", null, true);
shaderProgram.init(gl4);
programName = shaderProgram.program();
gl4.glProgramParameteri(programName, GL_PROGRAM_SEPARABLE, GL_TRUE);
shaderProgram.add(vertShaderCode);
shaderProgram.add(fragShaderCode);
shaderProgram.link(gl4, System.out);
int[] activeUniform = {0};
gl4.glGetProgramiv(programName, GL_ACTIVE_UNIFORMS, activeUniform, 0);
for (int i = 0; i < activeUniform[0]; ++i) {
byte[] name = new byte[128];
int[] length = {0};
gl4.glGetActiveUniformName(programName, i, name.length, length, 0, name, 0);
String stringName = new String(name).trim();
IntBuffer indices = GLBuffers.newDirectIntBuffer(1).put(0, i);
if (stringName.equals("Transform.mvp[0]")) {
gl4.glGetActiveUniformsiv(programName, 1, indices, GL_UNIFORM_ARRAY_STRIDE, uniformArrayStrideMat);
}
if (stringName.equals("Indirection.transform[0]")) {
gl4.glGetActiveUniformsiv(programName, 1, indices, GL_UNIFORM_ARRAY_STRIDE, uniformArrayStrideInt);
}
BufferUtils.destroyDirectBuffer(indices);
}
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName);
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例2: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "frag", null, true);
ShaderProgram shaderProgram = new ShaderProgram();
shaderProgram.init(gl4);
programName = shaderProgram.program();
gl4.glProgramParameteri(programName, GL_PROGRAM_SEPARABLE, GL_TRUE);
shaderProgram.add(vertShaderCode);
shaderProgram.add(fragShaderCode);
shaderProgram.link(gl4, System.out);
int[] activeUniform = {0};
gl4.glGetProgramiv(programName, GL_ACTIVE_UNIFORMS, activeUniform, 0);
for (int i = 0; i < activeUniform[0]; ++i) {
byte[] name = new byte[128];
int[] length = {0};
gl4.glGetActiveUniformName(programName, i, name.length, length, 0, name, 0);
String stringName = new String(name).trim();
if (stringName.equals("indirection.Transform[0]")) {
IntBuffer uniformIndices = GLBuffers.newDirectIntBuffer(new int[]{i});
gl4.glGetActiveUniformsiv(programName, 1, uniformIndices, GL_UNIFORM_ARRAY_STRIDE, uniformArrayStrideInt);
BufferUtils.destroyDirectBuffer(uniformIndices);
}
}
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName);
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例3: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "frag", null, true);
ShaderProgram shaderProgram = new ShaderProgram();
shaderProgram.init(gl4);
programName = shaderProgram.program();
gl4.glProgramParameteri(programName, GL_PROGRAM_SEPARABLE, GL_TRUE);
shaderProgram.add(vertShaderCode);
shaderProgram.add(fragShaderCode);
shaderProgram.link(gl4, System.out);
int[] activeUniform = {0};
gl4.glGetProgramiv(programName, GL_ACTIVE_UNIFORMS, activeUniform, 0);
for (int i = 0; i < activeUniform[0]; ++i) {
byte[] name = new byte[128];
int[] length = {0};
gl4.glGetActiveUniformName(programName, i, name.length, length, 0, name, 0);
String stringName = new String(name).trim();
if (stringName.equals("indirection.Transform[0]")) {
gl4.glGetActiveUniformsiv(programName, 1, new int[]{i}, 0, GL_UNIFORM_ARRAY_STRIDE,
uniformArrayStrideInt, 0);
}
}
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName, 0);
gl4.glUseProgramStages(pipelineName[0], GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}