Search in sources :

Example 6 with Node

use of org.terasology.rendering.dag.Node in project Terasology by MovingBlocks.

the class WorldRendererImpl method addInitialPostProcessingNodes.

private void addInitialPostProcessingNodes(RenderGraph renderGraph) {
    Node simpleBlendMaterialsNode = renderGraph.findNode("engine:simpleBlendMaterialsNode");
    Node one8thScaleBlurredBloomNode = renderGraph.findNode("engine:one8thScaleBlurredBloomNode");
    // Light shafts
    Node lightShaftsNode = new LightShaftsNode(context);
    renderGraph.addNode(lightShaftsNode, "lightShaftsNode");
    renderGraph.connect(simpleBlendMaterialsNode, lightShaftsNode);
    // Adding the bloom and light shafts to the gBuffer
    Node initialPostProcessingNode = new InitialPostProcessingNode(context);
    renderGraph.addNode(initialPostProcessingNode, "initialPostProcessingNode");
    renderGraph.connect(lightShaftsNode, initialPostProcessingNode);
    renderGraph.connect(one8thScaleBlurredBloomNode, initialPostProcessingNode);
}
Also used : LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode)

Example 7 with Node

use of org.terasology.rendering.dag.Node in project Terasology by MovingBlocks.

the class WorldRendererImpl method addOutputNodes.

private void addOutputNodes(RenderGraph renderGraph) {
    Node finalPostProcessingNode = renderGraph.findNode("engine:finalPostProcessingNode");
    Node outputToVRFrameBufferNode = new OutputToHMDNode(context);
    renderGraph.addNode(outputToVRFrameBufferNode, "outputToVRFrameBufferNode");
    renderGraph.connect(finalPostProcessingNode, outputToVRFrameBufferNode);
    Node outputToScreenNode = new OutputToScreenNode(context);
    renderGraph.addNode(outputToScreenNode, "outputToScreenNode");
    renderGraph.connect(finalPostProcessingNode, outputToScreenNode);
}
Also used : OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode)

Example 8 with Node

use of org.terasology.rendering.dag.Node in project Terasology by MovingBlocks.

the class WorldRendererImpl method initRenderGraph.

private void initRenderGraph() {
    addGBufferClearingNodes(renderGraph);
    addSkyNodes(renderGraph);
    addWorldRenderingNodes(renderGraph);
    addLightingNodes(renderGraph);
    add3dDecorationNodes(renderGraph);
    addReflectionAndRefractionNodes(renderGraph);
    addPrePostProcessingNodes(renderGraph);
    addBloomNodes(renderGraph);
    addExposureNodes(renderGraph);
    addInitialPostProcessingNodes(renderGraph);
    addFinalPostProcessingNodes(renderGraph);
    addOutputNodes(renderGraph);
    renderTaskListGenerator = new RenderTaskListGenerator();
    List<Node> orderedNodes = renderGraph.getNodesInTopologicalOrder();
    renderPipelineTaskList = renderTaskListGenerator.generateFrom(orderedNodes);
}
Also used : RenderTaskListGenerator(org.terasology.rendering.dag.RenderTaskListGenerator) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode)

Example 9 with Node

use of org.terasology.rendering.dag.Node 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);
}
Also used : AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode)

Example 10 with Node

use of org.terasology.rendering.dag.Node in project Terasology by MovingBlocks.

the class WorldRendererImpl method addPrePostProcessingNodes.

private void addPrePostProcessingNodes(RenderGraph renderGraph) {
    // Pre-post-processing, just one more interaction with 3D data (semi-transparent objects, in SimpleBlendMaterialsNode)
    // and then it's 2D post-processing all the way to the image shown on the display.
    Node overlaysNode = renderGraph.findNode("engine:overlaysNode");
    Node finalHazeNode = renderGraph.findNode("engine:finalHazeNode");
    Node chunksRefractiveReflectiveNode = renderGraph.findNode("engine:chunksRefractiveReflectiveNode");
    Node applyDeferredLightingNode = renderGraph.findNode("engine:applyDeferredLightingNode");
    Node outlineNode = renderGraph.findNode("engine:outlineNode");
    Node blurredAmbientOcclusionNode = renderGraph.findNode("engine:blurredAmbientOcclusionNode");
    Node prePostCompositeNode = new PrePostCompositeNode(context);
    renderGraph.addNode(prePostCompositeNode, "prePostCompositeNode");
    renderGraph.connect(overlaysNode, prePostCompositeNode);
    renderGraph.connect(finalHazeNode, prePostCompositeNode);
    renderGraph.connect(chunksRefractiveReflectiveNode, prePostCompositeNode);
    renderGraph.connect(applyDeferredLightingNode, prePostCompositeNode);
    renderGraph.connect(outlineNode, prePostCompositeNode);
    renderGraph.connect(blurredAmbientOcclusionNode, prePostCompositeNode);
    Node simpleBlendMaterialsNode = new SimpleBlendMaterialsNode(context);
    renderGraph.addNode(simpleBlendMaterialsNode, "simpleBlendMaterialsNode");
    renderGraph.connect(prePostCompositeNode, simpleBlendMaterialsNode);
}
Also used : SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode) PrePostCompositeNode(org.terasology.rendering.dag.nodes.PrePostCompositeNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode) InitialPostProcessingNode(org.terasology.rendering.dag.nodes.InitialPostProcessingNode) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OpaqueBlocksNode(org.terasology.rendering.dag.nodes.OpaqueBlocksNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) FinalPostProcessingNode(org.terasology.rendering.dag.nodes.FinalPostProcessingNode) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) LightShaftsNode(org.terasology.rendering.dag.nodes.LightShaftsNode) AlphaRejectBlocksNode(org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode) Node(org.terasology.rendering.dag.Node) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode) ToneMappingNode(org.terasology.rendering.dag.nodes.ToneMappingNode) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) OpaqueObjectsNode(org.terasology.rendering.dag.nodes.OpaqueObjectsNode) OutputToHMDNode(org.terasology.rendering.dag.nodes.OutputToHMDNode) LateBlurNode(org.terasology.rendering.dag.nodes.LateBlurNode) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) HazeNode(org.terasology.rendering.dag.nodes.HazeNode) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) SimpleBlendMaterialsNode(org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode) OutputToScreenNode(org.terasology.rendering.dag.nodes.OutputToScreenNode) BackdropNode(org.terasology.rendering.dag.nodes.BackdropNode) OverlaysNode(org.terasology.rendering.dag.nodes.OverlaysNode)

Aggregations

Node (org.terasology.rendering.dag.Node)13 AlphaRejectBlocksNode (org.terasology.rendering.dag.nodes.AlphaRejectBlocksNode)13 AmbientOcclusionNode (org.terasology.rendering.dag.nodes.AmbientOcclusionNode)13 ApplyDeferredLightingNode (org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode)13 BackdropNode (org.terasology.rendering.dag.nodes.BackdropNode)13 BackdropReflectionNode (org.terasology.rendering.dag.nodes.BackdropReflectionNode)13 BloomBlurNode (org.terasology.rendering.dag.nodes.BloomBlurNode)13 BlurredAmbientOcclusionNode (org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode)13 BufferClearingNode (org.terasology.rendering.dag.nodes.BufferClearingNode)13 DeferredMainLightNode (org.terasology.rendering.dag.nodes.DeferredMainLightNode)13 DeferredPointLightsNode (org.terasology.rendering.dag.nodes.DeferredPointLightsNode)13 DownSamplerForExposureNode (org.terasology.rendering.dag.nodes.DownSamplerForExposureNode)13 FinalPostProcessingNode (org.terasology.rendering.dag.nodes.FinalPostProcessingNode)13 HazeNode (org.terasology.rendering.dag.nodes.HazeNode)13 HighPassNode (org.terasology.rendering.dag.nodes.HighPassNode)13 InitialPostProcessingNode (org.terasology.rendering.dag.nodes.InitialPostProcessingNode)13 LateBlurNode (org.terasology.rendering.dag.nodes.LateBlurNode)13 LightShaftsNode (org.terasology.rendering.dag.nodes.LightShaftsNode)13 OpaqueBlocksNode (org.terasology.rendering.dag.nodes.OpaqueBlocksNode)13 OpaqueObjectsNode (org.terasology.rendering.dag.nodes.OpaqueObjectsNode)13