 typealias RenderStageNodeSelect = ((NodeGroup, [String]) -> [Node])
 typealias RenderStageNodeEncodeBlock = ((MTLRenderCommandEncoder, Node) -> Void)
 typealias RenderStageEncodeBlock = ((Renderer, [Node], RenderStageNodeEncodeBlock?) -> Void)
-typealias RenderStageTransitionBlock = ((Renderer, Renderer?) -> Renderer)
+typealias RenderStageTransitionBlock = ((Renderer, Renderer?) -> RenderEncoderTransition)
 
 protocol RenderStage: class {
     var nodes: [Node] { get set }

        encodeBlock!(renderer, nodes, nodeEncodeBlock)
    }
    
    func transition(renderer: Renderer, nextRenderer: Renderer?) -> Renderer {
        if let transitionTo = transitionBlock {
            return transitionTo(renderer, nextRenderer)
        } else {
            return renderer.transitionTo(nextRenderer)
        }
    }
}

    
    func selectNodes(nodeGroup: NodeGroup, keys: [String])
    func encode(renderer: Renderer, nodes: [Node])
    func transition(renderer: Renderer, nextRenderer: Renderer?) -> RenderEncoderTransition?
}

extension RenderStage {
