Ejemplo n.º 1
0
void VRShadowEngine::lightRenderEnter(Light        *pLight,
                                             RenderAction *pAction)
{
    if(pLight->getOn() == false)
        return;

    StateChunk   *pChunk          = pLight->getChunk();

    UInt32        uiSlot          = pChunk->getClassId();

    Int32         iLightIndex     = pAction->allocateLightIndex();

//    LightChunk   *pLightChunk     = dynamic_cast<LightChunk *>(pChunk);

//    Color4f tmpVal(0.0, 0.0, 0.0, 1.0);

//    pLightChunk->setAmbient(tmpVal);


    if(iLightIndex >= 0)
    {
        pAction->addOverride(uiSlot + iLightIndex, pChunk);
    }
    else
    {
        SWARNING << "maximum light source limit ("
                 << -iLightIndex
                 << ") is reached"
                 << " skipping light sources!"
                 << std::endl;
    }
}
Ejemplo n.º 2
0
void DrawEnv::updateChunk(State *pState)
{
    StateChunk   *c      = pState->getChunk(State::UpdateChunk);
    UInt32 const  climit = pState->getCoreGLChunkLimit();
   
    if(c != NULL && c->getIgnore() == false && c->getClassId() < climit)
    {
        (c)->changeFrom(this, c, UInt32(0));
    }
}
Ejemplo n.º 3
0
void DrawEnv::updateChunk(State         *pState,
                          StateOverride *pOverride)
{
    StateChunk   *c      = pState->getChunk(State::UpdateChunk);
    UInt32 const  climit = pState->getCoreGLChunkLimit();

    if(pOverride->size()         >  0                  &&
       pOverride->begin()->first == State::UpdateChunk  )
    {
        c = pOverride->begin()->second;
    }

    if(c != NULL && c->getIgnore() == false && c->getClassId() < climit)
    {
        c->changeFrom(this, c, UInt32(0));
    }
}