Search in sources :

Example 1 with ApplyDeferredLightingNode

use of org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode 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);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) ApplyDeferredLightingNode(org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode) ShadowMapNode(org.terasology.rendering.dag.nodes.ShadowMapNode) 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) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) DeferredPointLightsNode(org.terasology.rendering.dag.nodes.DeferredPointLightsNode) DeferredMainLightNode(org.terasology.rendering.dag.nodes.DeferredMainLightNode)

Example 2 with ApplyDeferredLightingNode

use of org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode 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
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) RefractiveReflectiveBlocksNode(org.terasology.rendering.dag.nodes.RefractiveReflectiveBlocksNode) 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) BufferClearingNode(org.terasology.rendering.dag.nodes.BufferClearingNode) BackdropReflectionNode(org.terasology.rendering.dag.nodes.BackdropReflectionNode) WorldReflectionNode(org.terasology.rendering.dag.nodes.WorldReflectionNode)

Example 3 with ApplyDeferredLightingNode

use of org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode 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)

Example 4 with ApplyDeferredLightingNode

use of org.terasology.rendering.dag.nodes.ApplyDeferredLightingNode 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);
}
Also used : BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) AmbientOcclusionNode(org.terasology.rendering.dag.nodes.AmbientOcclusionNode) 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) BlurredAmbientOcclusionNode(org.terasology.rendering.dag.nodes.BlurredAmbientOcclusionNode) OutlineNode(org.terasology.rendering.dag.nodes.OutlineNode)

Aggregations

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