use of org.terasology.rendering.dag.nodes.OpaqueObjectsNode 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.OpaqueObjectsNode in project Terasology by MovingBlocks.
the class WorldRendererImpl method addWorldRenderingNodes.
private void addWorldRenderingNodes(RenderGraph renderGraph) {
/* Ideally, world rendering nodes only depend on the gBufferClearingNode. However,
since the haze is produced by blurring the content of the gBuffer and we only want
the sky color to contribute to the haze, the world rendering nodes need to run
after finalHazeNode, so that the landscape and other meshes are not part of the haze.
Strictly speaking however, it is only the hazeIntermediateNode that should be processed
before the world rendering nodes. Here we have chosen to also ensure that finalHazeNode is
processed before the world rendering nodes - not because it's necessary, but to keep all
the haze-related nodes together. */
Node finalHazeNode = renderGraph.findNode("engine:finalHazeNode");
Node opaqueObjectsNode = new OpaqueObjectsNode(context);
renderGraph.addNode(opaqueObjectsNode, "opaqueObjectsNode");
renderGraph.connect(finalHazeNode, opaqueObjectsNode);
Node opaqueBlocksNode = new OpaqueBlocksNode(context);
renderGraph.addNode(opaqueBlocksNode, "opaqueBlocksNode");
renderGraph.connect(finalHazeNode, opaqueBlocksNode);
Node alphaRejectBlocksNode = new AlphaRejectBlocksNode(context);
renderGraph.addNode(alphaRejectBlocksNode, "alphaRejectBlocksNode");
renderGraph.connect(finalHazeNode, alphaRejectBlocksNode);
Node overlaysNode = new OverlaysNode(context);
renderGraph.addNode(overlaysNode, "overlaysNode");
renderGraph.connect(finalHazeNode, overlaysNode);
}
use of org.terasology.rendering.dag.nodes.OpaqueObjectsNode in project Terasology by MovingBlocks.
the class WorldRendererImpl method add3dDecorationNodes.
private void add3dDecorationNodes(RenderGraph renderGraph) {
Node opaqueObjectsNode = renderGraph.findNode("engine:opaqueObjectsNode");
Node opaqueBlocksNode = renderGraph.findNode("engine:opaqueBlocksNode");
Node alphaRejectBlocksNode = renderGraph.findNode("engine:alphaRejectBlocksNode");
Node applyDeferredLightingNode = renderGraph.findNode("engine:applyDeferredLightingNode");
Node outlineNode = new OutlineNode(context);
renderGraph.addNode(outlineNode, "outlineNode");
renderGraph.connect(opaqueObjectsNode, outlineNode);
renderGraph.connect(opaqueBlocksNode, outlineNode);
renderGraph.connect(alphaRejectBlocksNode, outlineNode);
Node ambientOcclusionNode = new AmbientOcclusionNode(context);
renderGraph.addNode(ambientOcclusionNode, "ambientOcclusionNode");
renderGraph.connect(opaqueObjectsNode, ambientOcclusionNode);
renderGraph.connect(opaqueBlocksNode, ambientOcclusionNode);
renderGraph.connect(alphaRejectBlocksNode, ambientOcclusionNode);
// TODO: At this stage, it is unclear -why- this connection is required, we just know that it's required. Investigate.
renderGraph.connect(applyDeferredLightingNode, ambientOcclusionNode);
Node blurredAmbientOcclusionNode = new BlurredAmbientOcclusionNode(context);
renderGraph.addNode(blurredAmbientOcclusionNode, "blurredAmbientOcclusionNode");
renderGraph.connect(ambientOcclusionNode, blurredAmbientOcclusionNode);
}
Aggregations