Search in sources :

Example 1 with SwappableFBO

use of org.terasology.rendering.opengl.SwappableFBO in project Terasology by MovingBlocks.

the class DisplayResolutionDependentFBOs method generateDefaultFBOs.

private void generateDefaultFBOs() {
    FBO gBuffer1 = generateWithDimensions(new FBOConfig(new SimpleUri("engine:fbo.gBuffer1"), FULL_SCALE, FBO.Type.HDR).useDepthBuffer().useNormalBuffer().useLightBuffer().useStencilBuffer(), fullScale);
    FBO gBuffer2 = generateWithDimensions(new FBOConfig(new SimpleUri("engine:fbo.gBuffer2"), FULL_SCALE, FBO.Type.HDR).useDepthBuffer().useNormalBuffer().useLightBuffer().useStencilBuffer(), fullScale);
    generateWithDimensions(new FBOConfig(FINAL_BUFFER, FULL_SCALE, FBO.Type.DEFAULT), fullScale);
    gBufferPair = new SwappableFBO(gBuffer1, gBuffer2);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) FBO(org.terasology.rendering.opengl.FBO) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) SimpleUri(org.terasology.engine.SimpleUri)

Example 2 with SwappableFBO

use of org.terasology.rendering.opengl.SwappableFBO in project Terasology by MovingBlocks.

the class WorldRendererImpl method addGBufferClearingNodes.

private void addGBufferClearingNodes(RenderGraph renderGraph) {
    SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair();
    BufferClearingNode lastUpdatedGBufferClearingNode = new BufferClearingNode(gBufferPair.getLastUpdatedFbo(), GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    renderGraph.addNode(lastUpdatedGBufferClearingNode, "lastUpdatedGBufferClearingNode");
    BufferClearingNode staleGBufferClearingNode = new BufferClearingNode(gBufferPair.getStaleFbo(), GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    renderGraph.addNode(staleGBufferClearingNode, "staleGBufferClearingNode");
}
Also used : SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode)

Aggregations

SwappableFBO (org.terasology.rendering.opengl.SwappableFBO)2 SimpleUri (org.terasology.engine.SimpleUri)1 BufferClearingNode (org.terasology.rendering.dag.nodes.BufferClearingNode)1 FBO (org.terasology.rendering.opengl.FBO)1 FBOConfig (org.terasology.rendering.opengl.FBOConfig)1