Skip to content

Commit

Permalink
Implement Settings To Control Rendering (#220)
Browse files Browse the repository at this point in the history
  • Loading branch information
datacrystals committed Jun 23, 2022
1 parent 0b856c3 commit df6209e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Source/EditorAssets/Projects/DefaultProject/10041.ERS
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ float StratifiedPoissonSamplerCube(float BiasedCurrentDepth, vec3 TexCoords3D, i

float shadow = 0.0;

/**
float samples = SampleSize;
float offset = 0.025;
for(float x = -offset; x < offset; x += offset / (samples * 0.5))
Expand All @@ -318,6 +319,24 @@ float StratifiedPoissonSamplerCube(float BiasedCurrentDepth, vec3 TexCoords3D, i
}
}
shadow /= (samples * samples * samples);

**/


int samples = SampleSize*SampleSize*SampleSize;
for(int i = 0; i < samples; ++i)
{
int PoissonIndex = int(16.0f*random(floor(gl_FragCoord.yxz*1000.0f), int(i)))%16;
vec3 PoissonOffset = vec3(Poisson3D[PoissonIndex]/150.0f);
float closestDepth = texture(DepthMapCubeArray, vec4(TexCoords3D + PoissonOffset, Index)).r;
closestDepth *= ViewDistance; // undo mapping [0;1]
if(BiasedCurrentDepth > closestDepth)
shadow += 1.0;
}
shadow /= float(samples);


return shadow;

return shadow;

Expand Down

0 comments on commit df6209e

Please sign in to comment.