mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:08:47 +02:00
Remove unneccessary const
This commit is contained in:
parent
b423bc38ba
commit
986af50b71
3 changed files with 10 additions and 13 deletions
|
@ -740,8 +740,8 @@ const ViewFrustum::Corners ViewFrustum::getCorners(const float& depth) {
|
||||||
glm::vec3 normal = glm::normalize(_direction);
|
glm::vec3 normal = glm::normalize(_direction);
|
||||||
|
|
||||||
auto getCorner = [&](enum::BoxVertex nearCorner, enum::BoxVertex farCorner) {
|
auto getCorner = [&](enum::BoxVertex nearCorner, enum::BoxVertex farCorner) {
|
||||||
const auto dir = glm::normalize(_cornersWorld[nearCorner] - _cornersWorld[farCorner]);
|
auto dir = glm::normalize(_cornersWorld[nearCorner] - _cornersWorld[farCorner]);
|
||||||
const auto factor = depth / glm::dot(dir, normal);
|
auto factor = depth / glm::dot(dir, normal);
|
||||||
return _position + factor * dir;
|
return _position + factor * dir;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,8 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
|
||||||
const Transform viewInverse{ _view.getInverseMatrix() };
|
const Transform viewInverse{ _view.getInverseMatrix() };
|
||||||
|
|
||||||
viewFrustum->calculate();
|
viewFrustum->calculate();
|
||||||
//const auto nearCorners = viewFrustum->getCorners(0);
|
auto nearCorners = viewFrustum->getCorners(nearDepth);
|
||||||
const auto nearClip = viewFrustum->getNearClip();
|
auto farCorners = viewFrustum->getCorners(farDepth);
|
||||||
const auto nearCorners = viewFrustum->getCorners(nearDepth);
|
|
||||||
const auto farCorners = viewFrustum->getCorners(farDepth);
|
|
||||||
|
|
||||||
vec3 min{ viewInverse.transform(nearCorners.bottomLeft) };
|
vec3 min{ viewInverse.transform(nearCorners.bottomLeft) };
|
||||||
vec3 max{ min };
|
vec3 max{ min };
|
||||||
|
@ -59,7 +57,6 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
|
||||||
max.y = glm::max(max.y, corner.y);
|
max.y = glm::max(max.y, corner.y);
|
||||||
max.z = glm::max(max.z, corner.z);
|
max.z = glm::max(max.z, corner.z);
|
||||||
};
|
};
|
||||||
fitFrustum(nearCorners.bottomLeft);
|
|
||||||
fitFrustum(nearCorners.bottomRight);
|
fitFrustum(nearCorners.bottomRight);
|
||||||
fitFrustum(nearCorners.topLeft);
|
fitFrustum(nearCorners.topLeft);
|
||||||
fitFrustum(nearCorners.topRight);
|
fitFrustum(nearCorners.topRight);
|
||||||
|
|
|
@ -78,21 +78,21 @@ RenderDeferredTask::RenderDeferredTask() : Task() {
|
||||||
initDeferredPipelines(*shapePlumber);
|
initDeferredPipelines(*shapePlumber);
|
||||||
|
|
||||||
// CPU: Fetch the renderOpaques
|
// 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;
|
context->getItemsConfig().opaque.numFeed = count;
|
||||||
}));
|
}));
|
||||||
const auto culledOpaques = addJob<CullItems<RenderDetails::OPAQUE_ITEM>>("CullOpaque", fetchedOpaques);
|
auto culledOpaques = addJob<CullItems<RenderDetails::OPAQUE_ITEM>>("CullOpaque", fetchedOpaques);
|
||||||
const auto opaques = addJob<DepthSortItems>("DepthSortOpaque", culledOpaques);
|
auto opaques = addJob<DepthSortItems>("DepthSortOpaque", culledOpaques);
|
||||||
|
|
||||||
// CPU only, create the list of renderedTransparents items
|
// 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(),
|
ItemFilter::Builder::transparentShape().withoutLayered(),
|
||||||
[](const RenderContextPointer& context, int count) {
|
[](const RenderContextPointer& context, int count) {
|
||||||
context->getItemsConfig().transparent.numFeed = count;
|
context->getItemsConfig().transparent.numFeed = count;
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
const auto culledTransparents = addJob<CullItems<RenderDetails::TRANSLUCENT_ITEM>>("CullTransparent", fetchedTransparents);
|
auto culledTransparents = addJob<CullItems<RenderDetails::TRANSLUCENT_ITEM>>("CullTransparent", fetchedTransparents);
|
||||||
const auto transparents = addJob<DepthSortItems>("DepthSortTransparent", culledTransparents, DepthSortItems(false));
|
auto transparents = addJob<DepthSortItems>("DepthSortTransparent", culledTransparents, DepthSortItems(false));
|
||||||
|
|
||||||
// GPU Jobs: Start preparing the deferred and lighting buffer
|
// GPU Jobs: Start preparing the deferred and lighting buffer
|
||||||
addJob<PrepareDeferred>("PrepareDeferred");
|
addJob<PrepareDeferred>("PrepareDeferred");
|
||||||
|
|
Loading…
Reference in a new issue