use of org.terasology.engine.rendering.dag.Node in project Terasology by MovingBlocks.
the class WorldRendererImpl method dagRedirect.
/**
* Redirect output FBO from one node to another's input
* <p>
* Usage: {@code dagRedirect <connectionTypeString> <fromNodeUri> <outputFboId> <toNodeUri> <inputFboId>}
* <p>
* Example: dagRedirect fbo blurredAmbientOcclusion 1 BasicRendering:outputToScreenNode 1 dagRedirect bufferpair
* backdrop 1 AdvancedRendering:intermediateHazeNode 1
*/
@Command(shortDescription = "Debugging command for DAG.", requiredPermission = PermissionManager.NO_PERMISSION)
public void dagRedirect(@CommandParam("fromNodeUri") final String connectionTypeString, @CommandParam("fromNodeUri") final String fromNodeUri, @CommandParam("outputFboId") final int outputFboId, @CommandParam("toNodeUri") final String toNodeUri, @CommandParam(value = "inputFboId") final int inputFboId) {
RenderGraph.ConnectionType connectionType;
if (connectionTypeString.equalsIgnoreCase("fbo")) {
connectionType = RenderGraph.ConnectionType.FBO;
} else if (connectionTypeString.equalsIgnoreCase("bufferpair")) {
connectionType = RenderGraph.ConnectionType.BUFFER_PAIR;
} else {
throw new RuntimeException(("Unsupported connection type: '" + connectionTypeString + "'. Expected 'fbo' " + "or 'bufferpair'.\n"));
}
Node toNode = renderGraph.findNode(toNodeUri);
if (toNode == null) {
toNode = renderGraph.findAka(toNodeUri);
if (toNode == null) {
throw new RuntimeException(("No node is associated with URI '" + toNodeUri + "'"));
}
}
Node fromNode = renderGraph.findNode(fromNodeUri);
if (fromNode == null) {
fromNode = renderGraph.findAka(fromNodeUri);
if (fromNode == null) {
throw new RuntimeException(("No node is associated with URI '" + fromNodeUri + "'"));
}
}
renderGraph.reconnectInputToOutput(fromNode, outputFboId, toNode, inputFboId, connectionType, true);
toNode.clearDesiredStateChanges();
requestTaskListRefresh();
}
use of org.terasology.engine.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.
* <p>
* Usage: {@code dagNodeCommand <nodeUri> <command> <parameters>}
* <p>
* 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) {
node = renderGraph.findAka(nodeUri);
if (node == null) {
throw new RuntimeException(("No node is associated with URI '" + nodeUri + "'"));
}
}
node.handleCommand(command, arguments);
}
Aggregations