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);
}
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);
}
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);
}
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);
}
Aggregations