CoreUtils.QuickSort(sortKeys,0,sortCount-1);// Call our own quicksort instead of Array.Sort(sortKeys, 0, sortCount) so we don't allocate memory (note the SortCount-1 that is different from original call).
caseLightTypeExtent.Line:
if(areaLightCount>=k_MaxAreaLightsOnScreen)
continue;
gpuLightType=GPULightType.Line;
lightVolumeType=LightVolumeType.Box;
break;
// TODO: Refactor shadow management
// The good way of managing shadow:
// Here we sort everyone and we decide which light is important or not (this is the responsibility of the lightloop)
// we allocate shadow slot based on maximum shadow allowed on screen and attribute slot by bigger solid angle
// THEN we ask to the ShadowRender to render the shadow, not the reverse as it is today (i.e render shadow than expect they
// will be use...)
// The lightLoop is in charge, not the shadow pass.
// For now we will still apply the maximum of shadow here but we don't apply the sorting by priority + slot allocation yet
m_CurrentSunLight=null;
m_CurrentSunLightShadowIndex=-1;
default:
Debug.Assert(false,"Encountered an unknown LightType.");
break;
}
}
// 2. Go through all lights, convert them to GPU format.
// Create simultaneously data for culling (LigthVolumeData and rendering)
CoreUtils.QuickSort(sortKeys,0,sortCount-1);// Call our own quicksort instead of Array.Sort(sortKeys, 0, sortCount) so we don't allocate memory (note the SortCount-1 that is different from original call).
varlight=cullResults.visibleLights[lightIndex];
// TODO: Refactor shadow management
// The good way of managing shadow:
// Here we sort everyone and we decide which light is important or not (this is the responsibility of the lightloop)
// we allocate shadow slot based on maximum shadow allowed on screen and attribute slot by bigger solid angle
// THEN we ask to the ShadowRender to render the shadow, not the reverse as it is today (i.e render shadow than expect they
// will be use...)
// The lightLoop is in charge, not the shadow pass.
// For now we will still apply the maximum of shadow here but we don't apply the sorting by priority + slot allocation yet
// Not necessary yet but call it for future modification with sphere influence volume
CoreUtils.QuickSort(sortKeys,0,sortCount-1);// Call our own quicksort instead of Array.Sort(sortKeys, 0, sortCount) so we don't allocate memory (note the SortCount-1 that is different from original call).
// Not necessary yet but call it for future modification with sphere influence volume
CoreUtils.QuickSort(sortKeys,0,sortCount-1);// Call our own quicksort instead of Array.Sort(sortKeys, 0, sortCount) so we don't allocate memory (note the SortCount-1 that is different from original call).