Skip to content
Permalink
Browse files

fixed the eye dome lighting effect issue

  • Loading branch information
NEDJIMAbelgacem committed Nov 11, 2020
1 parent 730817f commit 1a9061c2ff6f4a84db26c86a0dc71205e5a87a33
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/3d/shaders/postprocess.frag
@@ -92,11 +92,11 @@ float edlFactor(vec2 coords)
vec2 texelSize = 2.0 / textureSize(depthTexture, 0);
vec2 neighbours[4] = vec2[4](vec2(-1.0f, 0.0f), vec2(1.0f, 0.0f), vec2(0.0f, -1.0f), vec2(0.0f, 1.0f) );
float factor = 0.0f;
float centerDepth = texture2D(depthTexture, coords).r;
float centerDepth = linearizeDepth( texture2D(depthTexture, coords).r ) / farPlane;
for (int i = 0; i < 4; i++)
{
vec2 neighbourCoords = coords + edlDistance * texelSize * neighbours[i];
float neighbourDepth = texture2D(depthTexture, neighbourCoords).r;
float neighbourDepth = linearizeDepth( texture2D(depthTexture, neighbourCoords).r ) / farPlane;
neighbourDepth = (neighbourDepth == 1.0) ? 0.0 : neighbourDepth;
if (neighbourDepth != 0.0f)
{

0 comments on commit 1a9061c

Please sign in to comment.
You can’t perform that action at this time.