本文整理汇总了Java中com.jogamp.opengl.GL4.glProgramParameteri方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glProgramParameteri方法的具体用法?Java GL4.glProgramParameteri怎么用?Java GL4.glProgramParameteri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL4
的用法示例。
在下文中一共展示了GL4.glProgramParameteri方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
if (validated) {
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
ShaderCode geomShaderCode = ShaderCode.create(gl4, GL_GEOMETRY_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "geom", 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(geomShaderCode);
shaderProgram.add(fragShaderCode);
shaderProgram.link(gl4, System.out);
}
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName);
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_GEOMETRY_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;
// Create program
if (validated) {
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);
}
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;
gl4.glGenProgramPipelines(1, pipelineName);
// Create shaders
if (validated) {
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "vert", null, true);
ShaderCode geomShaderCode = ShaderCode.create(gl4, GL_GEOMETRY_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "geom", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
this.getClass(), SHADERS_ROOT, null, SHADERS_SOURCE, "frag", null, true);
if (validated) {
ShaderProgram shaderProgram = new ShaderProgram();
shaderProgram.init(gl4);
programName = shaderProgram.program();
gl4.glProgramParameteri(programName, GL_PROGRAM_SEPARABLE, GL_TRUE);
shaderProgram.add(vertShaderCode);
shaderProgram.add(geomShaderCode);
shaderProgram.add(fragShaderCode);
shaderProgram.link(gl4, System.out);
}
}
if (validated) {
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_GEOMETRY_SHADER_BIT
| GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例4: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
gl4.glGenProgramPipelines(1, pipelineName);
// Create program
if (validated) {
ShaderProgram vertProgram = new ShaderProgram();
ShaderProgram fragProgram = new ShaderProgram();
ShaderCode vertexShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "vert", null, true);
ShaderCode geometryShaderCode = ShaderCode.create(gl4, GL_GEOMETRY_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "geom", null, true);
ShaderCode fragmentShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "frag", null, true);
vertProgram.init(gl4);
fragProgram.init(gl4);
vertProgram.add(vertexShaderCode);
vertProgram.add(geometryShaderCode);
fragProgram.add(fragmentShaderCode);
programName[Program.VERT] = vertProgram.program();
programName[Program.FRAG] = fragProgram.program();
gl4.glProgramParameteri(programName[Program.VERT], GL_PROGRAM_SEPARABLE, GL_TRUE);
gl4.glProgramParameteri(programName[Program.FRAG], GL_PROGRAM_SEPARABLE, GL_TRUE);
vertProgram.link(gl4, System.out);
fragProgram.link(gl4, System.out);
}
if (validated) {
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_GEOMETRY_SHADER_BIT,
programName[Program.VERT]);
gl4.glUseProgramStages(pipelineName.get(0), GL_FRAGMENT_SHADER_BIT, programName[Program.FRAG]);
}
// Get variables locations
if (validated) {
uniformMvp = gl4.glGetUniformLocation(programName[Program.VERT], "mvp");
uniformDiffuse = gl4.glGetUniformLocation(programName[Program.FRAG], "diffuse");
}
return validated & checkError(gl4, "initProgram");
}
示例5: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
// Create program
if (validated) {
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER,
this.getClass(), SHADERS_ROOT, null, SAMPLE_SHADERS, "vert", null, true);
ShaderCode contShaderCode = ShaderCode.create(gl4, GL_TESS_CONTROL_SHADER,
this.getClass(), SHADERS_ROOT, null, SAMPLE_SHADERS, "cont", null, true);
ShaderCode evalShaderCode = ShaderCode.create(gl4, GL_TESS_EVALUATION_SHADER,
this.getClass(), SHADERS_ROOT, null, SAMPLE_SHADERS, "eval", null, true);
ShaderCode geomShaderCode = ShaderCode.create(gl4, GL_GEOMETRY_SHADER,
this.getClass(), SHADERS_ROOT, null, SAMPLE_SHADERS, "geom", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER,
this.getClass(), SHADERS_ROOT, null, SAMPLE_SHADERS, "frag", null, true);
ShaderProgram[] shaderPrograms = new ShaderProgram[]{new ShaderProgram(), new ShaderProgram()};
shaderPrograms[Program.VERT].init(gl4);
shaderPrograms[Program.FRAG].init(gl4);
programName[Program.VERT] = shaderPrograms[Program.VERT].program();
programName[Program.FRAG] = shaderPrograms[Program.FRAG].program();
gl4.glProgramParameteri(programName[Program.VERT], GL_PROGRAM_SEPARABLE, GL_TRUE);
gl4.glProgramParameteri(programName[Program.FRAG], GL_PROGRAM_SEPARABLE, GL_TRUE);
shaderPrograms[Program.VERT].add(vertShaderCode);
shaderPrograms[Program.VERT].add(contShaderCode);
shaderPrograms[Program.VERT].add(evalShaderCode);
shaderPrograms[Program.VERT].add(geomShaderCode);
shaderPrograms[Program.VERT].link(gl4, System.out);
shaderPrograms[Program.FRAG].add(fragShaderCode);
shaderPrograms[Program.FRAG].link(gl4, System.out);
}
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName);
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_TESS_CONTROL_SHADER_BIT
| GL_TESS_EVALUATION_SHADER_BIT | GL_GEOMETRY_SHADER_BIT, programName[Program.VERT]);
gl4.glUseProgramStages(pipelineName.get(0), GL_FRAGMENT_SHADER_BIT, programName[Program.FRAG]);
}
return validated & checkError(gl4, "initProgram");
}
示例6: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
// Create program
if (validated) {
ShaderProgram vertProgram = new ShaderProgram();
ShaderProgram fragProgram = new ShaderProgram();
ShaderCode vertShaderCode = ShaderCode.create(gl4, GL_VERTEX_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "vert", null, true);
ShaderCode contShaderCode = ShaderCode.create(gl4, GL_TESS_CONTROL_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "cont", null, true);
ShaderCode evalShaderCode = ShaderCode.create(gl4, GL_TESS_EVALUATION_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "eval", null, true);
ShaderCode geomShaderCode = ShaderCode.create(gl4, GL_GEOMETRY_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "geom", null, true);
ShaderCode fragShaderCode = ShaderCode.create(gl4, GL_FRAGMENT_SHADER, this.getClass(), SHADERS_ROOT,
null, SHADERS_SOURCE, "frag", null, true);
vertProgram.init(gl4);
fragProgram.init(gl4);
vertProgram.add(vertShaderCode);
vertProgram.add(contShaderCode);
vertProgram.add(evalShaderCode);
vertProgram.add(geomShaderCode);
fragProgram.add(fragShaderCode);
programName[Program.VERT] = vertProgram.program();
programName[Program.FRAG] = fragProgram.program();
gl4.glProgramParameteri(programName[Program.VERT], GL_PROGRAM_SEPARABLE, GL_TRUE);
gl4.glProgramParameteri(programName[Program.FRAG], GL_PROGRAM_SEPARABLE, GL_TRUE);
vertProgram.link(gl4, System.out);
fragProgram.link(gl4, System.out);
}
if (validated) {
uniformMvp = gl4.glGetUniformLocation(programName[Program.VERT], "mvp");
validated = validated && (uniformMvp != -1);
}
// Get variables locations
if (validated) {
gl4.glGenProgramPipelines(1, pipelineName);
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_TESS_CONTROL_SHADER_BIT
| GL_TESS_EVALUATION_SHADER_BIT | GL_GEOMETRY_SHADER_BIT, programName[Program.VERT]);
gl4.glUseProgramStages(pipelineName.get(0), GL_FRAGMENT_SHADER_BIT, programName[Program.FRAG]);
}
return validated & checkError(gl4, "initProgram");
}
示例7: 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");
}
示例8: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
gl4.glGenProgramPipelines(1, pipelineName);
if (validated) {
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);
}
if (validated) {
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例9: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
if (validated) {
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);
}
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");
}
示例10: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
gl4.glGenProgramPipelines(1, pipelineName);
// Create program
if (validated) {
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);
}
if (validated) {
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例11: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
// Create shaders
if (validated) {
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);
if (validated) {
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);
}
}
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");
}
示例12: initProgram
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initProgram(GL4 gl4) {
boolean validated = true;
gl4.glGenProgramPipelines(1, pipelineName);
// Create program
if (validated) {
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);
}
if (validated) {
gl4.glUseProgramStages(pipelineName.get(0), GL_VERTEX_SHADER_BIT | GL_FRAGMENT_SHADER_BIT, programName);
}
return validated & checkError(gl4, "initProgram");
}
示例13: 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");
}