OpenGL2: Fix issues running under WebGL

This commit is contained in:
Zack Middleton committed 2024-06-06 19:49:17 -04:00
1 parent 980147721a
commit 551fa6c797
5 files changed
+24 -10

No files matched your search

+2 -3
View File
@@ -52,10 +52,9 @@ vec4 depthGaussian1D(sampler2D imageMap, sampler2D depthMap, vec2 tex, float zFa
#endif
float zLimit = 5.0 / zFar;
int i, j;
for (i = 0; i < 2; i++)
for (int i = 0; i < 2; i++)
{
for (j = 1; j < BLUR_SIZE; j++)
for (int j = 1; j < BLUR_SIZE; j++)
{
vec2 offset = direction * (float(j) - 0.25) + nudge;
#if defined(USE_DEPTH)
+1 -2
View File
@@ -77,8 +77,7 @@ float ambientOcclusion(sampler2D depthMap, const vec2 tex, const float zFarDivZN
float invZFar = 1.0 / zFar;
float zLimit = 20.0 * invZFar;
int i;
for (i = 0; i < NUM_SAMPLES; i++)
for (int i = 0; i < NUM_SAMPLES; i++)
{
vec2 offset = rmat * poissonDisc[i] * offsetScale;
float sampleDiff = getLinearDepth(depthMap, tex + offset, zFarDivZNear) - sampleZ;