mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
DUmb fix to the flickering issue by overshooting the inside volume of the light and avoid the failing region
This commit is contained in:
parent
be27eaff24
commit
b492c4b52c
2 changed files with 2 additions and 4 deletions
|
@ -435,9 +435,9 @@ void DeferredLightingEffect::render(const render::RenderContextPointer& renderCo
|
|||
float expandedRadius = light->getMaximumRadius() * (1.0f + SCALE_EXPANSION);
|
||||
// TODO: We shouldn;t have to do that test and use a different volume geometry for when inside the vlight volume,
|
||||
// we should be able to draw thre same geometry use DepthClamp but for unknown reason it's s not working...
|
||||
const float OVER_CONSERVATIVE_SCALE = 1.1;
|
||||
if ((eyeHalfPlaneDistance > -nearRadius) &&
|
||||
(glm::distance(eyePoint, glm::vec3(light->getPosition())) < expandedRadius + nearRadius)) {
|
||||
light->setShowContour(true);
|
||||
(glm::distance(eyePoint, glm::vec3(light->getPosition())) < (expandedRadius * OVER_CONSERVATIVE_SCALE) + nearRadius)) {
|
||||
coneParam.w = 0.0f;
|
||||
batch._glUniform4fv(_spotLightLocations->coneParam, 1, reinterpret_cast< const float* >(&coneParam));
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ void main(void) {
|
|||
// Kill if in front of the light volume
|
||||
float depth = frag.depthVal;
|
||||
if (depth < gl_FragCoord.z) {
|
||||
_fragColor = vec4(1.0, 0.0, 0.0, 1.0);
|
||||
return;
|
||||
discard;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue