Search in sources :

Example 1 with SimpleBlendMaterialsNode

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

the class WorldRendererImpl method addBloomNodes.

private void addBloomNodes(RenderGraph renderGraph) {
    // Bloom Effect: one high-pass filter and three blur passes
    Node highPassNode = new HighPassNode(context);
    renderGraph.addNode(highPassNode, "highPassNode");
    FBOConfig halfScaleBloomConfig = new FBOConfig(BloomBlurNode.HALF_SCALE_FBO_URI, HALF_SCALE, FBO.Type.DEFAULT);
    FBO halfScaleBloomFbo = displayResolutionDependentFBOs.request(halfScaleBloomConfig);
    BloomBlurNode halfScaleBlurredBloomNode = new BloomBlurNode(context, displayResolutionDependentFBOs.get(HighPassNode.HIGH_PASS_FBO_URI), halfScaleBloomFbo);
    renderGraph.addNode(halfScaleBlurredBloomNode, "halfScaleBlurredBloomNode");
    FBOConfig quarterScaleBloomConfig = new FBOConfig(BloomBlurNode.QUARTER_SCALE_FBO_URI, QUARTER_SCALE, FBO.Type.DEFAULT);
    FBO quarterScaleBloomFbo = displayResolutionDependentFBOs.request(quarterScaleBloomConfig);
    BloomBlurNode quarterScaleBlurredBloomNode = new BloomBlurNode(context, halfScaleBloomFbo, quarterScaleBloomFbo);
    renderGraph.addNode(quarterScaleBlurredBloomNode, "quarterScaleBlurredBloomNode");
    FBOConfig one8thScaleBloomConfig = new FBOConfig(BloomBlurNode.ONE_8TH_SCALE_FBO_URI, ONE_8TH_SCALE, FBO.Type.DEFAULT);
    FBO one8thScaleBloomFbo = displayResolutionDependentFBOs.request(one8thScaleBloomConfig);
    BloomBlurNode one8thScaleBlurredBloomNode = new BloomBlurNode(context, quarterScaleBloomFbo, one8thScaleBloomFbo);
    renderGraph.addNode(one8thScaleBlurredBloomNode, "one8thScaleBlurredBloomNode");
    Node simpleBlendMaterialsNode = renderGraph.findNode("engine:simpleBlendMaterialsNode");
    renderGraph.connect(simpleBlendMaterialsNode, highPassNode, halfScaleBlurredBloomNode, quarterScaleBlurredBloomNode, one8thScaleBlurredBloomNode);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) SwappableFBO(org.terasology.rendering.opengl.SwappableFBO) FBO(org.terasology.rendering.opengl.FBO) BloomBlurNode(org.terasology.rendering.dag.nodes.BloomBlurNode) 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) HighPassNode(org.terasology.rendering.dag.nodes.HighPassNode)

Example 2 with SimpleBlendMaterialsNode

use of org.terasology.rendering.dag.nodes.SimpleBlendMaterialsNode 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 3 with SimpleBlendMaterialsNode

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

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

the class WorldRendererImpl method addExposureNodes.

private void addExposureNodes(RenderGraph renderGraph) {
    // TODO: Remove the hard coded value here
    FBOConfig gBuffer2Config = displayResolutionDependentFBOs.getFboConfig(new SimpleUri("engine:fbo.gBuffer2"));
    DownSamplerForExposureNode exposureDownSamplerTo16pixels = new DownSamplerForExposureNode(context, gBuffer2Config, displayResolutionDependentFBOs, FBO_16X16_CONFIG, immutableFBOs);
    renderGraph.addNode(exposureDownSamplerTo16pixels, "exposureDownSamplerTo16pixels");
    DownSamplerForExposureNode exposureDownSamplerTo8pixels = new DownSamplerForExposureNode(context, FBO_16X16_CONFIG, immutableFBOs, FBO_8X8_CONFIG, immutableFBOs);
    renderGraph.addNode(exposureDownSamplerTo8pixels, "exposureDownSamplerTo8pixels");
    DownSamplerForExposureNode exposureDownSamplerTo4pixels = new DownSamplerForExposureNode(context, FBO_8X8_CONFIG, immutableFBOs, FBO_4X4_CONFIG, immutableFBOs);
    renderGraph.addNode(exposureDownSamplerTo4pixels, "exposureDownSamplerTo4pixels");
    DownSamplerForExposureNode exposureDownSamplerTo2pixels = new DownSamplerForExposureNode(context, FBO_4X4_CONFIG, immutableFBOs, FBO_2X2_CONFIG, immutableFBOs);
    renderGraph.addNode(exposureDownSamplerTo2pixels, "exposureDownSamplerTo2pixels");
    DownSamplerForExposureNode exposureDownSamplerTo1pixel = new DownSamplerForExposureNode(context, FBO_2X2_CONFIG, immutableFBOs, FBO_1X1_CONFIG, immutableFBOs);
    renderGraph.addNode(exposureDownSamplerTo1pixel, "exposureDownSamplerTo1pixel");
    Node updateExposureNode = new UpdateExposureNode(context);
    renderGraph.addNode(updateExposureNode, "updateExposureNode");
    Node simpleBlendMaterialsNode = renderGraph.findNode("engine:simpleBlendMaterialsNode");
    renderGraph.connect(simpleBlendMaterialsNode, exposureDownSamplerTo16pixels, exposureDownSamplerTo8pixels, exposureDownSamplerTo4pixels, exposureDownSamplerTo2pixels, exposureDownSamplerTo1pixel, updateExposureNode);
}
Also used : FBOConfig(org.terasology.rendering.opengl.FBOConfig) UpdateExposureNode(org.terasology.rendering.dag.nodes.UpdateExposureNode) DownSamplerForExposureNode(org.terasology.rendering.dag.nodes.DownSamplerForExposureNode) 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) SimpleUri(org.terasology.engine.SimpleUri)

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