Use spatial tree for shadow fetch

This commit is contained in:
Zach Pomerantz 2016-02-26 11:58:21 -08:00
parent 8e1c514a9c
commit 6c3dd027a7

View file

@ -104,19 +104,17 @@ RenderShadowTask::RenderShadowTask(CullFunctor cullFunctor) : Task(std::make_sha
skinProgram, state);
}
// CPU: Fetch shadow-casting opaques
const auto fetchedItems = addJob<FetchItems>("FetchShadowMap");
// CPU jobs:
// Fetch and cull the items from the scene
auto shadowFilter = ItemFilter::Builder::visibleWorldItems().withTypeShape().withOpaque().withoutLayered();
const auto shadowSelection = addJob<FetchSpatialTree>("FetchShadowSelection", shadowFilter);
const auto culledShadowSelection = addJob<CullSpatialSelection>("CullShadowSelection", shadowSelection, cullFunctor, RenderDetails::SHADOW, shadowFilter);
// CPU: Cull against KeyLight frustum (nearby viewing camera)
const auto culledItems = addJob<CullItems<RenderDetails::SHADOW>>("CullShadowMap", fetchedItems, cullFunctor);
// Sort
const auto sortedShapes = addJob<PipelineSortShapes>("PipelineSortShadowSort", culledShadowSelection);
const auto shadowShapes = addJob<DepthSortItems>("DepthSortShadowMap", sortedShapes);
// CPU: Sort by pipeline
const auto sortedShapes = addJob<PipelineSortShapes>("PipelineSortShadowSort", culledItems);
// CPU: Sort front to back
const auto shadowShapes = addJob<DepthSortShapes>("DepthSortShadowMap", sortedShapes);
// GPU: Render to shadow map
// GPU jobs: Render to shadow map
addJob<RenderShadowMap>("RenderShadowMap", shadowShapes, shapePlumber);
}