本文整理汇总了Java中com.jogamp.opengl.GL4.glGenFramebuffers方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glGenFramebuffers方法的具体用法?Java GL4.glGenFramebuffers怎么用?Java GL4.glGenFramebuffers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL4
的用法示例。
在下文中一共展示了GL4.glGenFramebuffers方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
boolean validated = true;
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_WIDTH, windowSize.x);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_HEIGHT, windowSize.y);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_LAYERS, 1);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_SAMPLES, 1);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS, GL_TRUE);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return validated;
}
示例2: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(Framebuffer.MAX, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.MULTISAMPLE));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.MULTISAMPLE), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.MULTISAMPLE))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.COLOR));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLOR), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.COLOR))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例3: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(Framebuffer.MAX, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.MULTISAMPLE_COLORBUFFER), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.MULTISAMPLE_DEPTHBUFFER), 0);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.RENDER))) {
return false;
}
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.RESOLVE))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例4: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(0), 0, 0);
gl4.glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, textureName.get(0), 0, 1);
gl4.glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, textureName.get(0), 0, 2);
IntBuffer drawBuffers = GLBuffers.newDirectIntBuffer(new int[]{GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,
GL_COLOR_ATTACHMENT2});
gl4.glDrawBuffers(3, drawBuffers);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glDrawBuffer(GL_BACK);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
return checkError(gl4, "initFramebuffer");
}
示例5: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.R), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, textureName.get(Texture.G), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, textureName.get(Texture.B), 0);
IntBuffer drawBuffers = GLBuffers.newDirectIntBuffer(4);
drawBuffers.put(0, GL_NONE);
drawBuffers.put(1, GL_COLOR_ATTACHMENT0);
drawBuffers.put(2, GL_COLOR_ATTACHMENT1);
drawBuffers.put(3, GL_COLOR_ATTACHMENT2);
gl4.glDrawBuffers(4, drawBuffers);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例6: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
IntBuffer buffers = GLBuffers.newDirectIntBuffer(new int[]{GL_COLOR_ATTACHMENT0});
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureColorbufferName.get(0), 0);
gl4.glDrawBuffers(1, buffers);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glDrawBuffer(GL_BACK);
if (!isFramebufferComplete(gl4, 0)) {
return false;
}
return checkError(gl4, "initFramebuffer");
}
示例7: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName, 0);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName[0]);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_WIDTH, windowSize.x * supersampling);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_HEIGHT, windowSize.y * supersampling);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_LAYERS, 1);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_SAMPLES, 1);
gl4.glFramebufferParameteri(GL_FRAMEBUFFER, GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS, GL_TRUE);
if (!isFramebufferComplete(gl4, framebufferName[0])) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例8: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
IntBuffer buffersRender = GLBuffers.newDirectIntBuffer(new int[]{GL_COLOR_ATTACHMENT0});
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(0), 0);
gl4.glDrawBuffers(1, buffersRender);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glDrawBuffer(GL_BACK);
if (!isFramebufferComplete(gl4, 0)) {
return false;
}
BufferUtils.destroyDirectBuffer(buffersRender);
return checkError(gl4, "initFramebuffer");
}
示例9: FramebufferDesc
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
public FramebufferDesc(GL4 gl4, Vec2i size) {
gl4.glGenFramebuffers(Target.MAX, framebufferName);
gl4.glGenRenderbuffers(1, depthBufferName);
gl4.glGenTextures(Target.MAX, textureName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Target.RENDER));
gl4.glBindRenderbuffer(GL_RENDERBUFFER, depthBufferName.get(0));
gl4.glRenderbufferStorageMultisample(GL_RENDERBUFFER, 4, GL_DEPTH_COMPONENT, size.x, size.y);
gl4.glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBufferName.get(0));
gl4.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textureName.get(Target.RENDER));
gl4.glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA8, size.x, size.y, true);
gl4.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE,
textureName.get(Target.RENDER), 0);
if (!checkFramebufferStatus(gl4)) {
return;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Target.RESOLVE));
gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Target.RESOLVE));
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, 0);
gl4.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
gl4.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, size.x, size.y, 0, GL_RGBA, GL_UNSIGNED_BYTE, null);
gl4.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
textureName.get(Target.RESOLVE), 0);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
if (!checkFramebufferStatus(gl4)) {
return;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
}
示例10: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例11: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glBindTexture(GL_TEXTURE_2D_MULTISAMPLE, textureName.get(Texture.MULTISAMPLE));
// The second parameter is the number of samples.
gl4.glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, 4, GL_RGBA, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, false);
gl4.glGenFramebuffers(Framebuffer.MAX, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.MULTISAMPLE), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glBindTexture(GL_TEXTURE_2D, textureName.get(Texture.COLOR));
gl4.glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, 0, GL_RGBA,
GL_UNSIGNED_BYTE, null);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLOR), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.RESOLVE))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例12: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get());
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}
示例13: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.R), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, textureName.get(Texture.G), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, textureName.get(Texture.B), 0);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return checkError(gl4, "initFramebuffer");
}
示例14: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
boolean validated = true;
IntBuffer buffersRender = GLBuffers.newDirectIntBuffer(new int[]{GL_COLOR_ATTACHMENT0});
gl4.glGenFramebuffers(Framebuffer.MAX, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.FRAMEBUFFER));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER), 0);
gl4.glDrawBuffers(1, buffersRender);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.FRAMEBUFFER))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(Framebuffer.SHADOW));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, textureName.get(Texture.SHADOWMAP), 0);
gl4.glDrawBuffer(GL_NONE);
if (!isFramebufferComplete(gl4, framebufferName.get(Framebuffer.SHADOW))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
gl4.glDrawBuffer(GL_BACK);
if (!isFramebufferComplete(gl4, 0)) {
return false;
}
BufferUtils.destroyDirectBuffer(buffersRender);
return validated && checkError(gl4, "initFramebuffer");
}
示例15: initFramebuffer
import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initFramebuffer(GL4 gl4) {
gl4.glGenFramebuffers(1, framebufferName);
gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
gl4.glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER), 0);
gl4.glDrawBuffer(GL_COLOR_ATTACHMENT0);
if (!isFramebufferComplete(gl4, framebufferName.get(0))) {
return false;
}
gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
return true;
}