mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 14:06:22 +02:00
Adjusted bias
This commit is contained in:
parent
5d83284ac5
commit
44393f12d9
3 changed files with 6 additions and 5 deletions
|
@ -76,9 +76,10 @@ void LightStage::Shadow::setKeylightFrustum(const ViewFrustum& viewFrustum,
|
|||
fitFrustum(farCorners.topLeft);
|
||||
fitFrustum(farCorners.topRight);
|
||||
|
||||
// Re-adjust near shadow distance to
|
||||
max.z = glm::max(max.z, -nearDepth);
|
||||
glm::mat4 ortho = glm::ortho<float>(min.x, max.x, min.y, max.y, -max.z, -min.z);
|
||||
// Re-adjust near shadow distance
|
||||
auto near = glm::max(max.z, -nearDepth);
|
||||
auto far = -min.z;
|
||||
glm::mat4 ortho = glm::ortho<float>(min.x, max.x, min.y, max.y, near, far);
|
||||
_frustum->setProjection(ortho);
|
||||
|
||||
// Calculate the frustum's internal state
|
||||
|
|
|
@ -69,7 +69,7 @@ public:
|
|||
glm::mat4 projection;
|
||||
glm::mat4 viewInverse;
|
||||
|
||||
glm::float32 bias = 0.005f;
|
||||
glm::float32 bias = 0.003f;
|
||||
glm::float32 scale = 1 / MAP_SIZE;
|
||||
};
|
||||
UniformBufferView _schemaBuffer = nullptr;
|
||||
|
|
|
@ -203,7 +203,7 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext, con
|
|||
}
|
||||
|
||||
void RenderShadowTask::build(JobModel& task, const render::Varying& input, render::Varying& output, CullFunctor cullFunctor) {
|
||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&){ return true; };
|
||||
cullFunctor = cullFunctor ? cullFunctor : [](const RenderArgs*, const AABox&) { return true; };
|
||||
|
||||
// Prepare the ShapePipeline
|
||||
ShapePlumberPointer shapePlumber = std::make_shared<ShapePlumber>();
|
||||
|
|
Loading…
Reference in a new issue