use of org.terasology.rendering.dag.Node in project Terasology by MovingBlocks.
the class WorldRendererImpl method addSkyNodes.
private void addSkyNodes(RenderGraph renderGraph) {
Node backdropNode = new BackdropNode(context);
renderGraph.addNode(backdropNode, "backdropNode");
FBOConfig intermediateHazeConfig = new FBOConfig(HazeNode.INTERMEDIATE_HAZE_FBO_URI, ONE_16TH_SCALE, FBO.Type.DEFAULT);
FBO intermediateHazeFbo = displayResolutionDependentFBOs.request(intermediateHazeConfig);
HazeNode intermediateHazeNode = new HazeNode(context, displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(), intermediateHazeFbo);
renderGraph.addNode(intermediateHazeNode, "intermediateHazeNode");
FBOConfig finalHazeConfig = new FBOConfig(HazeNode.FINAL_HAZE_FBO_URI, ONE_32TH_SCALE, FBO.Type.DEFAULT);
FBO finalHazeFbo = displayResolutionDependentFBOs.request(finalHazeConfig);
HazeNode finalHazeNode = new HazeNode(context, intermediateHazeFbo, finalHazeFbo);
renderGraph.addNode(finalHazeNode, "finalHazeNode");
Node lastUpdatedGBufferClearingNode = renderGraph.findNode("engine:lastUpdatedGBufferClearingNode");
renderGraph.connect(lastUpdatedGBufferClearingNode, backdropNode, intermediateHazeNode, finalHazeNode);
}
use of org.terasology.rendering.dag.Node 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.Node 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.Node in project Terasology by MovingBlocks.
the class WorldRendererImpl method dagNodeCommand.
/**
* Acts as an interface between the console and the Nodes. All parameters passed to command are redirected to the
* concerned Nodes, which in turn take care of executing them.
*
* Usage:
* dagCommandNode <nodeUri> <command> <parameters>
*
* Example:
* dagNodeCommand engine:outputToScreenNode setFbo engine:fbo.ssao
*/
@Command(shortDescription = "Debugging command for DAG.", requiredPermission = PermissionManager.NO_PERMISSION)
public void dagNodeCommand(@CommandParam("nodeUri") final String nodeUri, @CommandParam("command") final String command, @CommandParam(value = "arguments") final String... arguments) {
Node node = renderGraph.findNode(nodeUri);
if (node == null) {
throw new RuntimeException(("No node is associated with URI '" + nodeUri + "'"));
}
node.handleCommand(command, arguments);
}
use of org.terasology.rendering.dag.Node 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
}
Aggregations