Bladeren bron

webgl 1.0 compat and cleanup

Alexander Rose 6 jaren geleden
bovenliggende
commit
a025d5ba0d

+ 1 - 2
src/mol-gl/shader/chunks/assign-material-color.glsl

@@ -17,14 +17,13 @@
     float at = 0.0;
 
     #if defined(dTransparencyVariant_single)
-        ivec2 pixelCoord = ivec2(gl_FragCoord.xy);
         const mat4 thresholdMatrix = mat4(
             1.0 / 17.0,  9.0 / 17.0,  3.0 / 17.0, 11.0 / 17.0,
             13.0 / 17.0,  5.0 / 17.0, 15.0 / 17.0,  7.0 / 17.0,
             4.0 / 17.0, 12.0 / 17.0,  2.0 / 17.0, 10.0 / 17.0,
             16.0 / 17.0,  8.0 / 17.0, 14.0 / 17.0,  6.0 / 17.0
         );
-        at = thresholdMatrix[pixelCoord.x % 4][pixelCoord.y % 4];
+        at = thresholdMatrix[int(intMod(gl_FragCoord.x, 4.0))][int(intMod(gl_FragCoord.y, 4.0))];
     #elif defined(dTransparencyVariant_multi)
         at = fract(dot(vec3(gl_FragCoord.xy, vGroup + 0.5), vec3(2.0, 7.0, 23.0) / 17.0f));
     #endif

+ 0 - 8
src/mol-gl/shader/chunks/common.glsl

@@ -1,14 +1,6 @@
 float intDiv(float a, float b) { return float(int(a) / int(b)); }
 float intMod(float a, float b) { return a - b * float(int(a) / int(b)); }
 
-float hash2d(vec2 coord2d) {
-    return fract(1.0e4 * sin(17.0 * coord2d.x + 0.1 * coord2d.y) * (0.1 + abs(sin(13.0 * coord2d.y + coord2d.x))));
-}
-
-float hash3d(vec3 coord3d) {
-    return hash2d(vec2(hash2d(coord3d.xy), coord3d.z));
-}
-
 #if __VERSION__ != 300
     // transpose
 

+ 0 - 1
src/mol-repr/visual.ts

@@ -97,7 +97,6 @@ namespace Visual {
             lociApply(loci, apply)
         }
         ValueCell.update(tOverpaint, tOverpaint.ref.value)
-        console.log(renderObject)
     }
 
     export function setTransparency(renderObject: GraphicsRenderObject | undefined, transparency: Transparency, lociApply: LociApply, clear: boolean) {