Exemple #1
0
 void UpdateCachedResults(int maxLod, List <int> activePassIds)
 {
     foreach (var passId in activePassIds)
     {
         MyPassLoddingSetting lodSetting = m_loddingSetting[passId];
         int currentLod = m_currentLod;
         currentLod = Math.Max(lodSetting.MinLod, currentLod + lodSetting.LodShift);
         currentLod = Math.Min(maxLod, currentLod);
         int transitionLod = m_transitionLod;
         transitionLod = Math.Max(lodSetting.MinLod, transitionLod + lodSetting.LodShift);
         transitionLod = Math.Min(maxLod, transitionLod);
         if (passId == 0)
         {
             if (m_transition == 0 || m_explicitState != MyInstanceLodState.Solid)
             {
                 MyLodStrategyCachedResultsUtils.UpdateSingleLod(m_cachedResults, passId,
                                                                 currentLod, m_explicitState, m_explicitStateData);
             }
             else
             {
                 MyLodStrategyCachedResultsUtils.UpdateTwoLods(m_cachedResults, passId,
                                                               currentLod, MyInstanceLodState.Transition, 1 - m_transition,
                                                               transitionLod, MyInstanceLodState.Transition, 2 + m_transition); // because of the implementation
             }
         }
         else
         {
             if (m_explicitState == MyInstanceLodState.Solid)
             {
                 MyLodStrategyCachedResultsUtils.UpdateSingleLod(m_cachedResults, passId,
                                                                 currentLod, MyInstanceLodState.Solid, 0);
             }
             else
             {
                 MyLodStrategyCachedResultsUtils.UpdateNoneLod(m_cachedResults, passId);
             }
         }
     }
 }