use of org.terasology.rendering.dag.nodes.BufferClearingNode in project Terasology by MovingBlocks.
the class WorldRendererImpl method addLightingNodes.
private void addLightingNodes(RenderGraph renderGraph) {
Node opaqueObjectsNode = renderGraph.findNode("engine:opaqueObjectsNode");
Node opaqueBlocksNode = renderGraph.findNode("engine:opaqueBlocksNode");
Node alphaRejectBlocksNode = renderGraph.findNode("engine:alphaRejectBlocksNode");
Node lastUpdatedGBufferClearingNode = renderGraph.findNode("engine:lastUpdatedGBufferClearingNode");
Node staleGBufferClearingNode = renderGraph.findNode("engine:staleGBufferClearingNode");
FBOConfig shadowMapConfig = new FBOConfig(ShadowMapNode.SHADOW_MAP_FBO_URI, FBO.Type.NO_COLOR).useDepthBuffer();
BufferClearingNode shadowMapClearingNode = new BufferClearingNode(shadowMapConfig, shadowMapResolutionDependentFBOs, GL_DEPTH_BUFFER_BIT);
renderGraph.addNode(shadowMapClearingNode, "shadowMapClearingNode");
shadowMapNode = new ShadowMapNode(context);
renderGraph.addNode(shadowMapNode, "shadowMapNode");
renderGraph.connect(shadowMapClearingNode, shadowMapNode);
Node deferredPointLightsNode = new DeferredPointLightsNode(context);
renderGraph.addNode(deferredPointLightsNode, "deferredPointLightsNode");
renderGraph.connect(opaqueObjectsNode, deferredPointLightsNode);
renderGraph.connect(opaqueBlocksNode, deferredPointLightsNode);
renderGraph.connect(alphaRejectBlocksNode, deferredPointLightsNode);
Node deferredMainLightNode = new DeferredMainLightNode(context);
renderGraph.addNode(deferredMainLightNode, "deferredMainLightNode");
renderGraph.connect(shadowMapNode, deferredMainLightNode);
renderGraph.connect(opaqueObjectsNode, deferredMainLightNode);
renderGraph.connect(opaqueBlocksNode, deferredMainLightNode);
renderGraph.connect(alphaRejectBlocksNode, deferredMainLightNode);
renderGraph.connect(deferredPointLightsNode, deferredMainLightNode);
Node applyDeferredLightingNode = new ApplyDeferredLightingNode(context);
renderGraph.addNode(applyDeferredLightingNode, "applyDeferredLightingNode");
renderGraph.connect(deferredMainLightNode, applyDeferredLightingNode);
renderGraph.connect(deferredPointLightsNode, applyDeferredLightingNode);
renderGraph.connect(lastUpdatedGBufferClearingNode, applyDeferredLightingNode);
renderGraph.connect(staleGBufferClearingNode, applyDeferredLightingNode);
}
use of org.terasology.rendering.dag.nodes.BufferClearingNode in project Terasology by MovingBlocks.
the class WorldRendererImpl method addReflectionAndRefractionNodes.
private void addReflectionAndRefractionNodes(RenderGraph renderGraph) {
FBOConfig reflectedBufferConfig = new FBOConfig(BackdropReflectionNode.REFLECTED_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT).useDepthBuffer();
BufferClearingNode reflectedBufferClearingNode = new BufferClearingNode(reflectedBufferConfig, displayResolutionDependentFBOs, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderGraph.addNode(reflectedBufferClearingNode, "reflectedBufferClearingNode");
Node reflectedBackdropNode = new BackdropReflectionNode(context);
renderGraph.addNode(reflectedBackdropNode, "reflectedBackdropNode");
Node worldReflectionNode = new WorldReflectionNode(context);
renderGraph.addNode(worldReflectionNode, "worldReflectionNode");
renderGraph.connect(reflectedBufferClearingNode, reflectedBackdropNode, worldReflectionNode);
FBOConfig reflectedRefractedBufferConfig = new FBOConfig(RefractiveReflectiveBlocksNode.REFRACTIVE_REFLECTIVE_FBO_URI, FULL_SCALE, FBO.Type.HDR).useNormalBuffer();
BufferClearingNode reflectedRefractedBufferClearingNode = new BufferClearingNode(reflectedRefractedBufferConfig, displayResolutionDependentFBOs, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
renderGraph.addNode(reflectedRefractedBufferClearingNode, "reflectedRefractedBufferClearingNode");
Node chunksRefractiveReflectiveNode = new RefractiveReflectiveBlocksNode(context);
renderGraph.addNode(chunksRefractiveReflectiveNode, "chunksRefractiveReflectiveNode");
Node applyDeferredLightingNode = renderGraph.findNode("engine:applyDeferredLightingNode");
renderGraph.connect(reflectedRefractedBufferClearingNode, chunksRefractiveReflectiveNode);
renderGraph.connect(worldReflectionNode, chunksRefractiveReflectiveNode);
// TODO: At this stage, it is unclear -why- this connection is required, we just know that it's required. Investigate.
renderGraph.connect(applyDeferredLightingNode, chunksRefractiveReflectiveNode);
// TODO: consider having a non-rendering node for FBO.attachDepthBufferTo() methods
}
use of org.terasology.rendering.dag.nodes.BufferClearingNode 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");
}
Aggregations