Exemplo n.º 1
0
void VBlobShadowManager::OnHandleCallback(IVisCallbackDataObject_cl *pData)
{
  // hook into an existing renderloop to render the shadows (before rendering particles)
  if (pData->m_pSender==&Vision::Callbacks.OnRenderHook)
  {
    if (m_Instances.Count() && ((VisRenderHookDataObject_cl *)pData)->m_iEntryConst == m_iRenderHookConst)
    {
      INSERT_PERF_MARKER_SCOPE("Blob Shadow Rendering (VBlobShadowManager::OnHandleCallback)");
      RenderAllShadows();
    }
  }

  // UnloadWorld : do some per-scene deinitialisation
  else if (pData->m_pSender==&Vision::Callbacks.OnWorldDeInit)
  {
    PurgeShadows();
    m_spDefaultFX = NULL;
    m_bFailedLoading = false;
    m_spDefaultShadowTex = NULL;
    m_spDefaultTech[0] = NULL;
    m_spDefaultTech[1] = NULL;
  }

  // Reassign shaders
  else if (pData->m_pSender == &Vision::Callbacks.OnReassignShaders)
  {
    // set shader resources to NULL, shaders will be recreated when 
    // GetDefaultTechnique is called next time.
    m_spDefaultFX = NULL;
    m_spDefaultTech[0] = NULL;
    m_spDefaultTech[1] = NULL;
  }
}
void VBlobShadowManager::ClearResources()
{
    PurgeShadows();
    m_spDefaultFX = NULL;
    m_bFailedLoading = false;
    m_spDefaultShadowTex = NULL;
    m_spDefaultTech[0] = NULL;
    m_spDefaultTech[1] = NULL;
}