Beispiel #1
0
void Channel::_orderImages( eq::ImageOps& images )
{
    const FrameData&    frameData = _getFrameData();
    const eq::Matrix4f& rotation  = frameData.getRotation();
    const eq::Matrix4f& modelView = useOrtho() ? eq::Matrix4f() :
                                                 _computeModelView();

    // calculate modelview inversed+transposed matrix
    const eq::Matrix4f& modelviewIM = modelView.inverse();
    const eq::Matrix3f& modelviewITM =
        vmml::transpose( eq::Matrix3f( modelviewIM ));
    orderImages( images, modelView, modelviewITM, rotation, useOrtho( ));
}
Beispiel #2
0
void Channel::frameDraw( const eq::uint128_t& )
{
    // Setup frustum
    EQ_GL_CALL( applyBuffer( ));
    EQ_GL_CALL( applyViewport( ));

    EQ_GL_CALL( glMatrixMode( GL_PROJECTION ));
    EQ_GL_CALL( glLoadIdentity( ));
    EQ_GL_CALL( applyFrustum( ));

    EQ_GL_CALL( glMatrixMode( GL_MODELVIEW ));
    EQ_GL_CALL( glLoadIdentity( ));

    // Setup lights before applying head transform, so the light will be
    // consistent in the cave
    const FrameData&    frameData   = _getFrameData();
    const eq::Matrix4f& rotation    = frameData.getRotation();
    const eq::Vector3f& translation = frameData.getTranslation();

    eq::Matrix4f     invRotationM;
    rotation.inverse( invRotationM );
    setLights( invRotationM );

    EQ_GL_CALL( applyHeadTransform( ));

    glTranslatef(  translation.x(), translation.y(), translation.z() );
    glMultMatrixf( rotation.array );

    Pipe*     pipe     = static_cast<Pipe*>( getPipe( ));
    Renderer* renderer = pipe->getRenderer();
    LBASSERT( renderer );

    const eq::Matrix4f& modelview = _computeModelView();

    // set fancy data colors
    const eq::Vector4f taintColor = _getTaintColor( frameData.getColorMode(),
                                                    getUniqueColor( ));
    const int normalsQuality = _getFrameData().getNormalsQuality();

    const eq::Range& range = getRange();
    renderer->render( range, modelview, invRotationM, taintColor,
                      normalsQuality );
    checkError( "error during rendering " );

    _drawRange = range;

#ifndef NDEBUG
    outlineViewport();
#endif
}
Beispiel #3
0
void Channel::_orderFrames( eq::Frames& frames )
{
    const FrameData&    frameData = _getFrameData();
    const eq::Matrix4f& rotation  = frameData.getRotation();

    const eq::Matrix4f& modelView = useOrtho() ? eq::Matrix4f::IDENTITY :
                                                 _computeModelView();

    //calculate modelview inversed transposed matrix
    eq::Matrix3f modelviewITM;
    eq::Matrix4f modelviewIM;
    modelView.inverse( modelviewIM );
    eq::Matrix3f( modelviewIM ).transpose_to( modelviewITM );

    orderFrames( frames, modelView, modelviewITM, rotation, useOrtho( ));
}