当前位置: 首页>>代码示例>>Java>>正文


Java GL4.glMapNamedBufferRange方法代码示例

本文整理汇总了Java中com.jogamp.opengl.GL4.glMapNamedBufferRange方法的典型用法代码示例。如果您正苦于以下问题:Java GL4.glMapNamedBufferRange方法的具体用法?Java GL4.glMapNamedBufferRange怎么用?Java GL4.glMapNamedBufferRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.GL4的用法示例。


在下文中一共展示了GL4.glMapNamedBufferRange方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: begin

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean begin(GL gl) {

    GL4 gl4 = (GL4) gl;

    boolean validated = gl4.isExtensionAvailable("GL_ARB_sparse_buffer");

    if (validated) {
        validated = initProgram(gl4);
    }
    if (validated) {
        validated = initBuffer(gl4);
    }
    if (validated) {
        validated = initVertexArray(gl4);
    }
    if (validated) {
        validated = initTexture(gl4);
    }
    if (validated) {
        uniformPointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM), 0, Mat4.SIZE, GL_MAP_WRITE_BIT
                | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
    }

    return validated;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:27,代码来源:Gl_500_buffer_sparse_arb.java

示例2: render

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {

    GL4 gl4 = (GL4) gl;
    {
        ByteBuffer pointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM),
                0, uniformBlockSize, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, FRAMEBUFFER_SIZE.x / FRAMEBUFFER_SIZE.y, 0.1f,
                100.0f);
        pointer.position(0);
        pointer.asFloatBuffer().put(projection.mul(viewMat4()).mul(new Mat4(1)).toFa_());

        // Make sure the uniform buffer is uploaded
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.TRANSFORM));
    }

    gl4.glBindProgramPipeline(pipelineName.get(0));

    // Step 1: render the scene in a multisampled framebuffer
    renderFBO(gl4);

    // Step 2: resolve MSAA
    gl4.glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferName.get(Framebuffer.RENDER));
    gl4.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
    gl4.glBlitFramebuffer(
            0, 0, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y,
            0, 0, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);

    // Step 3: Blit resolved colorbuffer. Resolve and blit can't be done in a single step
    gl4.glBindFramebuffer(GL_READ_FRAMEBUFFER, framebufferName.get(Framebuffer.RESOLVE));
    gl4.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
    gl4.glBlitFramebuffer(
            0, 0, FRAMEBUFFER_SIZE.x, FRAMEBUFFER_SIZE.y,
            0, 0, windowSize.x, windowSize.y, GL_COLOR_BUFFER_BIT, GL_NEAREST);

    return true;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:39,代码来源:Gl_430_direct_state_access_ext.java

示例3: initBuffer

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initBuffer(GL4 gl4) {

        ShortBuffer elementBuffer = GLBuffers.newDirectShortBuffer(elementSize);
        FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
        IntBuffer uniformBufferOffset = GLBuffers.newDirectIntBuffer(1);

        gl4.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, uniformBufferOffset);
        uniformBlockSize = Math.max(Mat4.SIZE, uniformBufferOffset.get(0));

        gl4.glCreateBuffers(Buffer.MAX, bufferName);

        if (!bug1287) {

            gl4.glNamedBufferStorage(bufferName.get(Buffer.ELEMENT), elementSize, elementBuffer, 0);
            gl4.glNamedBufferStorage(bufferName.get(Buffer.VERTEX), vertexSize, vertexBuffer, 0);
            gl4.glNamedBufferStorage(bufferName.get(Buffer.TRANSFORM), uniformBlockSize * 2, null, GL_MAP_WRITE_BIT
                    | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
        } else {

            gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT));
            gl4.glBufferStorage(GL_ELEMENT_ARRAY_BUFFER, elementSize, elementBuffer, 0);
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));
            gl4.glBufferStorage(GL_ARRAY_BUFFER, vertexSize, vertexBuffer, 0);
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
            gl4.glBufferStorage(GL_UNIFORM_BUFFER, uniformBlockSize * 2, null, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT
                    | GL_MAP_COHERENT_BIT);
        }

        uniformPointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM), 0, uniformBlockSize * 2,
                GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        BufferUtils.destroyDirectBuffer(elementBuffer);
        BufferUtils.destroyDirectBuffer(vertexBuffer);
        BufferUtils.destroyDirectBuffer(uniformBufferOffset);

        return true;
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:38,代码来源:Gl_450_direct_state_access.java

示例4: render

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {

    GL4 gl4 = (GL4) gl;

    // Update of the uniform buffer
    {
        ByteBuffer pointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM),
                0, Mat4.SIZE, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        Mat4 projection = glm.perspectiveFov_((float) Math.PI * 0.25f, windowSize.x, windowSize.y, 0.1f, 100.0f);
        Mat4 model = new Mat4(1.0f);

        pointer.asFloatBuffer().put(projection.mul(viewMat4()).mul(model).toFa_());

        // Make sure the uniform buffer is uploaded
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.TRANSFORM));
    }

    gl4.glViewportIndexedf(0, 0, 0, windowSize.x, windowSize.y);
    gl4.glClearBufferfv(GL_COLOR, 0, clearColor);

    int locationDiffuse = 0;
    gl4.glProgramUniformHandleui64ARB(programName, locationDiffuse, textureHandle.get(0));

    gl4.glBindProgramPipeline(pipelineName.get(0));
    gl4.glBindVertexArray(vertexArrayName.get(0));
    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));

    gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0);

    return true;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:34,代码来源:Gl_500_texture_bindless_nv.java

示例5: render

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {

    GL4 gl4 = (GL4) gl;

    {
        ByteBuffer pointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM),
                0, Mat4.SIZE * 1, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, 4.0f / 3.0f, 0.1f, 100.0f);
        Mat4 model = new Mat4(1.0f);

        pointer.asFloatBuffer().put(projection.mul(viewMat4()).mul(model).toFa_());

        // Make sure the uniform buffer is uploaded
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.TRANSFORM));
    }

    gl4.glViewport(0, 0, windowSize.x, windowSize.y);
    gl4.glClearBufferfv(GL_COLOR, 0, black);

    gl4.glBindProgramPipeline(pipelineName.get(0));
    gl4.glBindVertexArray(vertexArrayName.get(0));
    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));

    gl4.glBeginQuery(GL_PRIMITIVES_GENERATED, queryName.get(0));
    {
        gl4.glDrawElementsInstancedBaseVertex(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 1, 0);
    }
    gl4.glEndQuery(GL_PRIMITIVES_GENERATED);

    LongBuffer primitivesGeneratedBuffer = GLBuffers.newDirectLongBuffer(1);
    gl4.glGetQueryObjectui64v(queryName.get(0), GL_QUERY_RESULT, primitivesGeneratedBuffer);
    long primitivesGenerated = primitivesGeneratedBuffer.get(0);

    return primitivesGenerated > 0;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:38,代码来源:Gl_500_primitive_shading_nv.java

示例6: initBuffer

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initBuffer(GL4 gl4) {

        IntBuffer uniformBufferOffset = GLBuffers.newDirectIntBuffer(1);
        gl4.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, uniformBufferOffset);
        uniformBlockSize = Math.max(Mat4.SIZE, uniformBufferOffset.get(0));

        ShortBuffer elementBuffer = GLBuffers.newDirectShortBuffer(elementData);
        FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);

        gl4.glCreateBuffers(Buffer.MAX, bufferName);

        if (!bug1287) {

            gl4.glNamedBufferStorage(bufferName.get(Buffer.ELEMENT), elementSize, elementBuffer, 0);
            gl4.glNamedBufferStorage(bufferName.get(Buffer.VERTEX), vertexSize, vertexBuffer, 0);
            gl4.glNamedBufferStorage(bufferName.get(Buffer.TRANSFORM), uniformBlockSize * 2, null, GL_MAP_WRITE_BIT
                    | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);

        } else {

            gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufferName.get(Buffer.ELEMENT));
            gl4.glBufferStorage(GL_ELEMENT_ARRAY_BUFFER, elementSize, elementBuffer, 0);
            gl4.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
            gl4.glBindBuffer(GL_ARRAY_BUFFER, bufferName.get(Buffer.VERTEX));
            gl4.glBufferStorage(GL_ARRAY_BUFFER, vertexSize, vertexBuffer, 0);
            gl4.glBindBuffer(GL_ARRAY_BUFFER, 0);
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
            gl4.glBufferStorage(GL_UNIFORM_BUFFER, uniformBlockSize * 2, null, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT
                    | GL_MAP_COHERENT_BIT);
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, 0);
        }

        uniformPointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM), 0, uniformBlockSize * 2,
                GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        BufferUtils.destroyDirectBuffer(uniformBufferOffset);
        BufferUtils.destroyDirectBuffer(elementBuffer);
        BufferUtils.destroyDirectBuffer(vertexBuffer);

        return true;
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:42,代码来源:Gl_500_direct_state_access_gtc.java

示例7: render

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {

    GL4 gl4 = (GL4) gl;

    {
        ByteBuffer pointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM),
                0, Mat4.SIZE, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, (float) windowSize.x / windowSize.y, 0.1f, 100.0f);
        Mat4 model = new Mat4(1.0f);

        pointer.asFloatBuffer().put(projection.mul(viewMat4()).mul(model).toFa_());

        // Make sure the uniform buffer is uploaded
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.TRANSFORM));
    }

    gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
    gl4.glViewportIndexedf(0, 0, 0, windowSize.x / 16.0f, windowSize.y / 16.0f);

    gl4.glClearBufferfv(GL_COLOR, 0, whiteColor);

    // Bind rendering objects
    gl4.glViewportIndexedf(0, 0, 0, windowSize.x / 16.0f, windowSize.y / 16.0f);
    gl4.glBindProgramPipeline(pipelineName.get(Pipeline.TEXTURE));
    gl4.glBindVertexArray(vertexArrayName.get(Pipeline.TEXTURE));
    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));

    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.MATERIAL, bufferName.get(Buffer.MATERIAL0));

    //glSubpixelPrecisionBiasNV(-8, -8);
    gl4.glEnable(GL_CONSERVATIVE_RASTERIZATION_NV);
    gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0);

    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.MATERIAL, bufferName.get(Buffer.MATERIAL1));

    gl4.glDisable(GL_CONSERVATIVE_RASTERIZATION_NV);
    gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 1, 0, 0);

    gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
    gl4.glViewportIndexedf(0, 0, 0, windowSize.x, windowSize.y);

    gl4.glBindProgramPipeline(pipelineName.get(Pipeline.SPLASH));
    gl4.glBindVertexArray(vertexArrayName.get(Pipeline.SPLASH));
    gl4.glBindTextureUnit(0, textureName.get(Texture.COLORBUFFER));

    gl4.glDrawArraysInstancedBaseInstance(GL_TRIANGLES, 0, 3, 1, 0);

    return true;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:52,代码来源:Gl_500_conservative_raster_nv.java

示例8: initBuffer

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
private boolean initBuffer(GL4 gl4) {

        int alignement = 256;
        IntBuffer bufferPageSize = GLBuffers.newDirectIntBuffer(1);        
        FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(vertexData);
        ShortBuffer elementBuffer = GLBuffers.newDirectShortBuffer(elementData);
        
        gl4.glGetIntegerv(GL_SPARSE_BUFFER_PAGE_SIZE_ARB, bufferPageSize);

        boolean validated = true;

        int copyBufferSize = glm.ceilMultiple(vertexSize, alignement) + glm.ceilMultiple(elementSize, alignement);

        gl4.glCreateBuffers(Buffer.MAX, bufferName);

        if (!bug1287) {
            gl4.glNamedBufferStorage(bufferName.get(Buffer.COPY), copyBufferSize, null, GL_MAP_WRITE_BIT);
        } else {
            gl4.glBindBuffer(GL_SHADER_STORAGE_BUFFER, bufferName.get(Buffer.COPY));
            gl4.glBufferStorage(GL_SHADER_STORAGE_BUFFER, copyBufferSize, null, GL_MAP_WRITE_BIT);
            gl4.glBindBuffer(GL_SHADER_STORAGE_BUFFER, 0);
        }

        ByteBuffer copyBufferPointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.COPY), 0, copyBufferSize,
                GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
        copyBufferPointer.asFloatBuffer().put(vertexBuffer);
        copyBufferPointer.position(glm.ceilMultiple(vertexSize, alignement));
        copyBufferPointer.asShortBuffer().put(elementBuffer);
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.COPY));

        gl4.glBindBuffer(GL_COPY_READ_BUFFER, bufferName.get(Buffer.COPY));

        gl4.glBindBuffer(GL_COPY_WRITE_BUFFER, bufferName.get(Buffer.ELEMENT));
        gl4.glBufferStorage(GL_COPY_WRITE_BUFFER, glm.ceilMultiple(elementSize, bufferPageSize.get(0)), null,
                GL_SPARSE_STORAGE_BIT_ARB);
        gl4.glBufferPageCommitmentARB(GL_COPY_WRITE_BUFFER, 0, bufferPageSize.get(0), true);
        gl4.glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, glm.ceilMultiple(vertexSize, alignement),
                0, glm.ceilMultiple(elementSize, alignement));

        gl4.glBindBuffer(GL_COPY_WRITE_BUFFER, bufferName.get(Buffer.VERTEX));
        gl4.glBufferStorage(GL_COPY_WRITE_BUFFER, glm.ceilMultiple(vertexSize, bufferPageSize.get(0)), null,
                GL_SPARSE_STORAGE_BIT_ARB);
        gl4.glBufferPageCommitmentARB(GL_COPY_WRITE_BUFFER, 0, bufferPageSize.get(0), true);
        gl4.glCopyBufferSubData(GL_COPY_READ_BUFFER, GL_COPY_WRITE_BUFFER, 0, 0, glm.ceilMultiple(vertexSize, alignement));

        int[] uniformBufferOffset = {0};
        gl4.glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, uniformBufferOffset, 0);
        int uniformBlockSize = Math.max(Mat4.SIZE, uniformBufferOffset[0]);

        if (!bug1287) {
            gl4.glNamedBufferStorage(bufferName.get(Buffer.TRANSFORM), uniformBlockSize, null, GL_MAP_WRITE_BIT
                    | GL_MAP_PERSISTENT_BIT | GL_MAP_COHERENT_BIT);
        } else {
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, bufferName.get(Buffer.TRANSFORM));
            gl4.glBufferStorage(GL_UNIFORM_BUFFER, uniformBlockSize, null, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT
                    | GL_MAP_COHERENT_BIT);
            gl4.glBindBuffer(GL_UNIFORM_BUFFER, 0);
        }

        BufferUtils.destroyDirectBuffer(vertexBuffer);
        BufferUtils.destroyDirectBuffer(elementBuffer);
        BufferUtils.destroyDirectBuffer(bufferPageSize);

        return validated;
    }
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:66,代码来源:Gl_500_buffer_sparse_arb.java

示例9: render

import com.jogamp.opengl.GL4; //导入方法依赖的package包/类
@Override
protected boolean render(GL gl) {

    GL4 gl4 = (GL4) gl;

    {
        ByteBuffer pointer = gl4.glMapNamedBufferRange(bufferName.get(Buffer.TRANSFORM),
                0, Mat4.SIZE, GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);

        Mat4 projection = glm.perspective_((float) Math.PI * 0.25f, (float) windowSize.x / windowSize.y, 0.1f, 100.0f);
        Mat4 model = new Mat4(1.0f);

        pointer.asFloatBuffer().put(projection.mul(viewMat4()).mul(model).toFa_());

        // Make sure the uniform buffer is uploaded
        gl4.glUnmapNamedBuffer(bufferName.get(Buffer.TRANSFORM));
    }

    gl4.glEnable(GL_DEPTH_TEST);
    gl4.glDepthFunc(GL_LESS);

    gl4.glClearTexImage(textureName.get(Texture.COLORBUFFER), 0, GL_RGBA, GL_UNSIGNED_BYTE, clearColorBuffer);
    gl4.glClearTexImage(textureName.get(Texture.RENDERBUFFER), 0, GL_DEPTH_COMPONENT, GL_FLOAT, clearRenderBuffer);
    gl4.glClearTexImage(textureName.get(Texture.INVOCATION_COUNT), 0, GL_RED_INTEGER, GL_UNSIGNED_INT,
            clearInvocationCount);

    gl4.glViewportIndexedf(0, 0, 0, windowSize.x * FRAMEBUFFER_SCALE, windowSize.y * FRAMEBUFFER_SCALE);

    gl4.glBindFramebuffer(GL_FRAMEBUFFER, framebufferName.get(0));
    gl4.glBindProgramPipeline(pipelineName.get(Pipeline.TEXTURE));
    gl4.glBindVertexArray(vertexArrayName.get(Pipeline.TEXTURE));
    gl4.glBindBufferBase(GL_UNIFORM_BUFFER, Semantic.Uniform.TRANSFORM0, bufferName.get(Buffer.TRANSFORM));
    gl4.glBindImageTexture(0, textureName.get(Texture.INVOCATION_COUNT), 0, false, 0, GL_WRITE_ONLY, GL_R32UI);

    gl4.glDrawElementsInstancedBaseVertexBaseInstance(GL_TRIANGLES, elementCount, GL_UNSIGNED_SHORT, 0, 5, 0, 0);

    gl4.glDisable(GL_DEPTH_TEST);

    gl4.glViewportIndexedf(0, 0, 0, windowSize.x, windowSize.y);

    gl4.glBindFramebuffer(GL_FRAMEBUFFER, 0);
    gl4.glBindProgramPipeline(pipelineName.get(Pipeline.SPLASH));
    gl4.glBindVertexArray(vertexArrayName.get(Pipeline.SPLASH));
    gl4.glBindImageTexture(0, textureName.get(Texture.INVOCATION_COUNT), 0, false, 0, GL_READ_ONLY, GL_R32UI);

    gl4.glDrawArraysInstancedBaseInstance(GL_TRIANGLES, 0, 3, 1, 0);

    return true;
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:50,代码来源:Gl_500_shader_group_nv.java


注:本文中的com.jogamp.opengl.GL4.glMapNamedBufferRange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。