Remove unneccessary const

This commit is contained in:
Zach Pomerantz 2016-01-15 10:50:42 -08:00
parent b423bc38ba
commit 986af50b71
3 changed files with 10 additions and 13 deletions
libraries

View file

@ -740,8 +740,8 @@ const ViewFrustum::Corners ViewFrustum::getCorners(const float& depth) {
glm::vec3 normal = glm::normalize(_direction);
auto getCorner = [&](enum::BoxVertex nearCorner, enum::BoxVertex farCorner) {
const auto dir = glm::normalize(_cornersWorld[nearCorner] - _cornersWorld[farCorner]);
const auto factor = depth / glm::dot(dir, normal);
auto dir = glm::normalize(_cornersWorld[nearCorner] - _cornersWorld[farCorner]);
auto factor = depth / glm::dot(dir, normal);
return _position + factor * dir;
};

View file

@ -40,10 +40,8 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
const Transform viewInverse{ _view.getInverseMatrix() };
viewFrustum->calculate();
//const auto nearCorners = viewFrustum->getCorners(0);
const auto nearClip = viewFrustum->getNearClip();
const auto nearCorners = viewFrustum->getCorners(nearDepth);
const auto farCorners = viewFrustum->getCorners(farDepth);
auto nearCorners = viewFrustum->getCorners(nearDepth);
auto farCorners = viewFrustum->getCorners(farDepth);
vec3 min{ viewInverse.transform(nearCorners.bottomLeft) };
vec3 max{ min };
@ -59,7 +57,6 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
max.y = glm::max(max.y, corner.y);
max.z = glm::max(max.z, corner.z);
};
fitFrustum(nearCorners.bottomLeft);
fitFrustum(nearCorners.bottomRight);
fitFrustum(nearCorners.topLeft);
fitFrustum(nearCorners.topRight);

View file

@ -78,21 +78,21 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
initDeferredPipelines(*shapePlumber);
// CPU: Fetch the renderOpaques
const auto fetchedOpaques = addJob<FetchItems>("FetchOpaque", FetchItems([](const RenderContextPointer& context, int count) {
auto fetchedOpaques = addJob<FetchItems>("FetchOpaque", FetchItems([](const RenderContextPointer& context, int count) {
context->getItemsConfig().opaque.numFeed = count;
}));
const auto culledOpaques = addJob<CullItems<RenderDetails::OPAQUE_ITEM>>("CullOpaque", fetchedOpaques);
const auto opaques = addJob<DepthSortItems>("DepthSortOpaque", culledOpaques);
auto culledOpaques = addJob<CullItems<RenderDetails::OPAQUE_ITEM>>("CullOpaque", fetchedOpaques);
auto opaques = addJob<DepthSortItems>("DepthSortOpaque", culledOpaques);
// CPU only, create the list of renderedTransparents items
const auto fetchedTransparents = addJob<FetchItems>("FetchTransparent", FetchItems(
auto fetchedTransparents = addJob<FetchItems>("FetchTransparent", FetchItems(
ItemFilter::Builder::transparentShape().withoutLayered(),
[](const RenderContextPointer& context, int count) {
context->getItemsConfig().transparent.numFeed = count;
}
));
const auto culledTransparents = addJob<CullItems<RenderDetails::TRANSLUCENT_ITEM>>("CullTransparent", fetchedTransparents);
const auto transparents = addJob<DepthSortItems>("DepthSortTransparent", culledTransparents, DepthSortItems(false));
auto culledTransparents = addJob<CullItems<RenderDetails::TRANSLUCENT_ITEM>>("CullTransparent", fetchedTransparents);
auto transparents = addJob<DepthSortItems>("DepthSortTransparent", culledTransparents, DepthSortItems(false));
// GPU Jobs: Start preparing the deferred and lighting buffer
addJob<PrepareDeferred>("PrepareDeferred");