Ejemplo n.º 1
0
void HDRStage::initData(Viewport         *pViewport,
                        RenderActionBase *pAction  )
{
    HDRStageDataUnrecPtr pData = pAction->getData<HDRStageData *>(_iDataSlotId);

    if(pData == NULL)
    {
        pData = setupStageData(pViewport->getPixelWidth(),
                               pViewport->getPixelHeight());
        
        pData->setWidth (pViewport->getPixelWidth ());
        pData->setHeight(pViewport->getPixelHeight());

        this->setData(pData, _iDataSlotId, pAction);
    }
}
Ejemplo n.º 2
0
void HDRStage::initData(RenderAction *pAction,
                        Int32         iVPWidth,
                        Int32         iVPHeight)
{
    HDRStageDataUnrecPtr pData = pAction->getData<HDRStageData *>(_iDataSlotId);

    if(pData == NULL)
    {
        pData = setupStageData(iVPWidth,
                               iVPHeight);

        pData->setWidth (iVPWidth );
        pData->setHeight(iVPHeight);

        this->setData(pData, _iDataSlotId, pAction);
    }
}
Ejemplo n.º 3
0
void HDRStage::updateData(RenderAction *pAction,
                          Int32         iVPWidth,
                          Int32         iVPHeight)
{
    HDRStageDataUnrecPtr pData = pAction->getData<HDRStageData *>(_iDataSlotId);

    if(pData == NULL)
    {
        initData(pAction, iVPWidth, iVPHeight);

        pData = pAction->getData<HDRStageData *>(_iDataSlotId);
    }
    else if((pData->getWidth () != iVPWidth ) ||
            (pData->getHeight() != iVPHeight)  )
    {
        resizeStageData(pData, 
                        iVPWidth,
                        iVPHeight);

        pData->setWidth (iVPWidth );
        pData->setHeight(iVPHeight);
    }

    ChunkMaterial* pTonemapMat = pData->getToneMappingMaterial();
    BlendChunk*    pBlendChunk = static_cast<BlendChunk*>(
        pTonemapMat->find(BlendChunk::getClassType()));

    if(pBlendChunk != NULL)
        pBlendChunk->setIgnore(!getCombineBlend());
}