Browse Source

webgl1 compat

Alexander Rose 2 years ago
parent
commit
b26d62a067
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/mol-gl/shader/ssao-blur.frag.ts

+ 2 - 2
src/mol-gl/shader/ssao-blur.frag.ts

@@ -74,7 +74,7 @@ void main(void) {
     float kernelSum = 0.0;
     // only if kernelSize is odd
     for (int i = -dOcclusionKernelSize / 2; i <= dOcclusionKernelSize / 2; i++) {
-        if (abs(i) > 1 && abs(float(i)) * pixelSize > 0.5) continue;
+        if (abs(float(i)) > 1.0 && abs(float(i)) * pixelSize > 0.5) continue;
 
         vec2 sampleCoords = coords + float(i) * offset;
         if (outsideBounds(sampleCoords)) {
@@ -88,7 +88,7 @@ void main(void) {
             continue;
         }
 
-        if (abs(float(i)) > 1.0) { // abs is not defined for int in webgl1
+        if (abs(float(i)) > 1.0) {
             float sampleViewZ = getViewZ(sampleDepth);
             if (abs(selfViewZ - sampleViewZ) > maxDiffViewZ) {
                 continue;