Browse Source

bug fixes and wboit for text and images

Aron Kovacs 4 years ago
parent
commit
c81476d2a7

+ 5 - 0
src/mol-canvas3d/passes/draw.ts

@@ -126,6 +126,11 @@ export class DrawPass {
 
         // console.log('toDrawingBuffer', toDrawingBuffer);
 
+        for (let i = 0; i < this.webgl.gl.getParameter(this.webgl.gl.MAX_TEXTURE_IMAGE_UNITS); i++) {
+            this.webgl.gl.activeTexture(this.webgl.gl.TEXTURE0 + i);
+            this.webgl.gl.bindTexture(this.webgl.gl.TEXTURE_2D, null);
+        }
+
         let renderTarget;
         if (toDrawingBuffer) {
             renderTarget = null;

+ 4 - 0
src/mol-gl/shader/image.frag.ts

@@ -10,6 +10,7 @@ precision highp int;
 #include common
 #include read_from_texture
 #include common_frag_params
+#include wboit_params
 
 uniform vec2 uImageTexDim;
 uniform sampler2D tImageTex;
@@ -122,6 +123,9 @@ void main() {
         float vMarker = readFromTexture(tMarker, vInstance * float(uGroupCount) + group, uMarkerTexDim).a;
         #include apply_marker_color
         #include apply_fog
+
+        float absFragDepth = abs(gl_FragCoord.z);
+        #include wboit_write
     #endif
 }
 `;

+ 4 - 0
src/mol-gl/shader/text.frag.ts

@@ -12,6 +12,7 @@ precision highp int;
 #include common_frag_params
 #include color_frag_params
 #include common_clip
+#include wboit_params
 
 uniform sampler2D tFont;
 
@@ -65,6 +66,9 @@ void main(){
     #elif defined(dRenderVariant_color)
         #include apply_marker_color
         #include apply_fog
+
+        float absFragDepth = abs(gl_FragCoord.z);
+        #include wboit_write
     #endif
 }
 `;