本文整理汇总了Java中org.lwjgl.opengl.GL20.glDrawBuffers方法的典型用法代码示例。如果您正苦于以下问题:Java GL20.glDrawBuffers方法的具体用法?Java GL20.glDrawBuffers怎么用?Java GL20.glDrawBuffers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL20
的用法示例。
在下文中一共展示了GL20.glDrawBuffers方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawBuffers
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void drawBuffers() {
bind();
IntBuffer buffer = BufferUtils.createIntBuffer(textureids.size());
for(int i : textureids)
buffer.put(GL30.GL_COLOR_ATTACHMENT0 + i);
buffer.flip();
GL20.glDrawBuffers(buffer);
unbind();
}
示例2: setDrawBuffers
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void setDrawBuffers(IntBuffer drawBuffers)
{
if (drawBuffers == null)
{
drawBuffers = drawBuffersNone;
}
if (activeDrawBuffers != drawBuffers)
{
activeDrawBuffers = drawBuffers;
GL20.glDrawBuffers(drawBuffers);
}
}
示例3: clearRenderBuffer
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void clearRenderBuffer()
{
if (isShadowPass)
{
checkGLError("shadow clear pre");
EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL20.glDrawBuffers(programsDrawBuffers[30]);
checkFramebufferStatus("shadow clear");
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
checkGLError("shadow clear");
}
else
{
checkGLError("clear pre");
GL20.glDrawBuffers(36064);
GL11.glClear(16384);
GL20.glDrawBuffers(36065);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glClear(16384);
for (int i = 2; i < usedColorBuffers; ++i)
{
GL20.glDrawBuffers(36064 + i);
GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
GL11.glClear(16384);
}
setDrawBuffers(dfbDrawBuffers);
checkFramebufferStatus("clear");
checkGLError("clear");
}
}
示例4: startRenderToFBO
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public void startRenderToFBO(){
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
IntBuffer drawBuffs = BufferUtils.createIntBuffer(1);
drawBuffs.put(0, GL_COLOR_ATTACHMENT0);
GL20.glDrawBuffers(drawBuffs);
glViewport(0,0,Main.WIDTH,Main.HEIGHT);
}
示例5: setupShadowFrameBuffer
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
private static void setupShadowFrameBuffer()
{
if (usedShadowDepthBuffers != 0)
{
if (sfb != 0)
{
EXTFramebufferObject.glDeleteFramebuffersEXT(sfb);
GlStateManager.deleteTextures(sfbDepthTextures);
GlStateManager.deleteTextures(sfbColorTextures);
}
sfb = EXTFramebufferObject.glGenFramebuffersEXT();
EXTFramebufferObject.glBindFramebufferEXT(36160, sfb);
GL11.glDrawBuffer(0);
GL11.glReadBuffer(0);
GL11.glGenTextures((IntBuffer)sfbDepthTextures.clear().limit(usedShadowDepthBuffers));
GL11.glGenTextures((IntBuffer)sfbColorTextures.clear().limit(usedShadowColorBuffers));
sfbDepthTextures.position(0);
sfbColorTextures.position(0);
for (int i = 0; i < usedShadowDepthBuffers; ++i)
{
GlStateManager.bindTexture(sfbDepthTextures.get(i));
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
int j = shadowFilterNearest[i] ? 9728 : 9729;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, j);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, j);
if (shadowHardwareFilteringEnabled[i])
{
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_COMPARE_MODE, GL14.GL_COMPARE_R_TO_TEXTURE);
}
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, shadowMapWidth, shadowMapHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null));
}
EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
checkGLError("FT sd");
for (int k = 0; k < usedShadowColorBuffers; ++k)
{
GlStateManager.bindTexture(sfbColorTextures.get(k));
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10496.0F);
GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10496.0F);
int i1 = shadowColorFilterNearest[k] ? 9728 : 9729;
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i1);
GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, i1);
GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_RGBA, shadowMapWidth, shadowMapHeight, 0, GL12.GL_BGRA, GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null));
EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, sfbColorTextures.get(k), 0);
checkGLError("FT sc");
}
GlStateManager.bindTexture(0);
if (usedShadowColorBuffers > 0)
{
GL20.glDrawBuffers(sfbDrawBuffers);
}
int l = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160);
if (l != 36053)
{
printChatAndLogError("[Shaders] Error: Failed creating shadow framebuffer! (Status " + l + ")");
}
else
{
SMCLog.info("Shadow framebuffer created.");
}
}
}
示例6: clearRenderBuffer
import org.lwjgl.opengl.GL20; //导入方法依赖的package包/类
public static void clearRenderBuffer()
{
if (isShadowPass)
{
checkGLError("shadow clear pre");
EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL20.glDrawBuffers(programsDrawBuffers[30]);
checkFramebufferStatus("shadow clear");
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
checkGLError("shadow clear");
}
else
{
checkGLError("clear pre");
if (gbuffersClear[0])
{
GL20.glDrawBuffers(36064);
GL11.glClear(16384);
}
if (gbuffersClear[1])
{
GL20.glDrawBuffers(36065);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glClear(16384);
}
for (int i = 2; i < usedColorBuffers; ++i)
{
if (gbuffersClear[i])
{
GL20.glDrawBuffers(36064 + i);
GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
GL11.glClear(16384);
}
}
setDrawBuffers(dfbDrawBuffers);
checkFramebufferStatus("clear");
checkGLError("clear");
}
}