Example #1
0
    void frameDraw( const eq::uint128_t& )
    {
        applyCamera();
        initializeLivreFrustum();
        requestData();

        const eq::fabric::Viewport& vp = _channel->getViewport( );
        const Viewport viewport( vp.x, vp.y, vp.w, vp.h );
        _renderViewPtr->setViewport( viewport );

        livre::Node* node = static_cast< livre::Node* >( _channel->getNode( ));
        livre::Window* window = static_cast< livre::Window* >( _channel->getWindow( ));
        AvailableSetGenerator generateSet( node->getDashTree( ),
                                           window->getTextureCache( ));

        _frameInfo.clear();
        generateSet.generateRenderingSet( _currentFrustum, _frameInfo );

        EqRenderViewPtr renderViewPtr =
                boost::static_pointer_cast< EqRenderView >( _renderViewPtr );
        RayCastRendererPtr renderer =
                boost::static_pointer_cast< RayCastRenderer >(
                    renderViewPtr->getRenderer( ));

        const livre::Pipe* pipe = static_cast< const livre::Pipe* >( _channel->getPipe( ));
        renderer->initTransferFunction(
            pipe->getFrameData()->getRenderSettings()->getTransferFunction( ));

        RenderBricks renderBricks;
        generateRenderBricks( _frameInfo.renderNodes, renderBricks );
        renderViewPtr->render( _frameInfo, renderBricks, *_glWidgetPtr );
    }
Example #2
0
    void frameDraw( const eq::uint128_t& )
    {
        livre::Node* node = static_cast< livre::Node* >( _channel->getNode( ));
        const DashRenderStatus& renderStatus = node->getDashTree()->getRenderStatus();
        const uint32_t frame = renderStatus.getFrameID();
        if( frame >= INVALID_FRAME )
            return;

        applyCamera();
        initializeLivreFrustum();
        const DashRenderNodes& visibles = requestData();

        const eq::fabric::Viewport& vp = _channel->getViewport( );
        const Viewport viewport( vp.x, vp.y, vp.w, vp.h );
        _renderViewPtr->setViewport( viewport );

        livre::Window* window = static_cast< livre::Window* >( _channel->getWindow( ));
        const livre::Pipe* pipe = static_cast< const livre::Pipe* >( _channel->getPipe( ));

        const bool isSynchronous = pipe->getFrameData()->getVRParameters()->getSynchronousMode();

        // #75: only wait for data in synchronous mode
        const bool dashTreeUpdated = window->apply( isSynchronous );

        if( dashTreeUpdated )
        {
            const Frustum& receivedFrustum = renderStatus.getFrustum();

            // If there are multiple channels, this may cause the ping-pong
            // because every channel will try to update the same DashTree in
            // node with their own frustum.
            if( !isSynchronous && receivedFrustum != _currentFrustum )
                _channel->getConfig()->sendEvent( REDRAW );
        }

        const AvailableSetGenerator generateSet( node->getDashTree(),
                                                 window->getTextureCache( ));

        _frameInfo.clear();
        for( const auto& visible : visibles )
            _frameInfo.allNodes.push_back(visible.getLODNode().getNodeId());
        generateSet.generateRenderingSet( _frameInfo );

        EqRenderViewPtr renderViewPtr =
                boost::static_pointer_cast< EqRenderView >( _renderViewPtr );
        RayCastRendererPtr renderer =
                boost::static_pointer_cast< RayCastRenderer >(
                    renderViewPtr->getRenderer( ));

        renderer->update( *pipe->getFrameData( ));

        RenderBricks renderBricks;
        generateRenderBricks( _frameInfo.renderNodes, renderBricks );
        renderViewPtr->render( _frameInfo, renderBricks, *_glWidgetPtr );
        updateRegions( renderBricks );
    }
Example #3
0
    void frameDraw( const eq::uint128_t& )
    {
        applyCamera();
        initializeLivreFrustum();
        requestData();

        const eq::fabric::Viewport& vp = _channel->getViewport( );
        const Viewportf viewport( Vector2f( vp.x, vp.y ),
                                  Vector2f( vp.w, vp.h ));
        _renderViewPtr->setViewport( viewport );

        Viewporti pixelViewport;
        _glWidgetPtr->setViewport( _renderViewPtr.get( ), pixelViewport );

        livre::Node* node = static_cast< livre::Node* >( _channel->getNode( ));
        AvailableSetGenerator generateSet( node->getDashTree( ));

        FrameInfo frameInfo( _currentFrustum );
        generateSet.generateRenderingSet( _currentFrustum,
                                          frameInfo);

        EqRenderViewPtr renderViewPtr =
                boost::static_pointer_cast< EqRenderView >( _renderViewPtr );

        renderViewPtr->setParameters( getFrameData()->getVRParameters( ));

        RayCastRendererPtr renderer =
                boost::static_pointer_cast< RayCastRenderer >(
                    renderViewPtr->getRenderer( ));

        const livre::Pipe* pipe = static_cast< const livre::Pipe* >( _channel->getPipe());
        renderer->initTransferFunction(
                    pipe->getFrameData()->getRenderSettings()->getTransferFunction( ));

        RenderBricks renderBricks;
        generateRenderBricks( frameInfo.renderNodeList,
                              renderBricks );

        renderViewPtr->render( frameInfo,
                               renderBricks,
                               *_glWidgetPtr );
    }