Repository: vispy/vispy

Issue:
Buggy display with iso volume example
Using `examples/basics/scene/volume.py` and switching to iso rendering method produces a [pretty strange view](http://youtu.be/3becSPxKIq8).
![screenshot from 2015-06-02 20-33-11](https://cloud.githubusercontent.com/assets/302469/7952618/7438357a-0986-11e5-8771-cafdb56cde95.png)

System is the same as before (Intel HD 4600):

```
Platform: Linux-4.0.4-301.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two
Python:   3.4.2 (default, Jan 12 2015, 12:13:20)  [GCC 4.9.2 20150107 (Red Hat 4.9.2-5)]
Backend:  PyQt4
pyqt4:    ('PyQt4', '4.11.3', '4.8.6')
pyqt5:    None
pyside:   None
pyglet:   pyglet 1.2.1
glfw:     None
sdl2:     None
wx:       None
egl:      EGL 1.4 (DRI2) Mesa Project: OpenGL OpenGL_ES OpenGL_ES2 OpenGL_ES3
_test:    None

GL version:  '3.0 Mesa 10.5.4'
MAX_TEXTURE_SIZE: 8192
```



Discussion:
OpenGL on Intel :(  I would love to see how this looks in WebGL on the same driver.

Do you have a sample? I tried to throw it in the notebook, but it doesn't seem like the WebGL backend is ready for this example just yet (or I did something wrong.)

No I don't think the Volume rendering works in WebGL yet. Sorry I probably should have mentioned that.

On current master, it is now a bunch of purple cubes.
![screenshot from 2015-09-21 23-32-44](https://cloud.githubusercontent.com/assets/302469/10010410/1f3997b4-60b9-11e5-9d2f-010c9a335fe5.png)

wow I wish all bugs were that pretty

Did you try playing with the iso threshold? If that threshold is off, you can get weird results...

There are artifacts on the supposed-to-be transparent regions, e.g., with a threshold at 2, which is _way_ above anything in the file, there is still this random noise:
![screenshot from 2015-09-24 03-57-07](https://cloud.githubusercontent.com/assets/302469/10068237/bd1de74c-6270-11e5-8044-43d0be4e4b7f.png)

That noise seems to appear on the backfaces. i.e. when the threshold has not been reached, the sample is not transparent as it should. Is this noise the only problem?

Can you try adding `gl_FragColor = vec4(0.0);` here:
https://github.com/vispy/vispy/blob/master/vispy/visuals/volume.py#L336

That does help somewhat. For example, with threshold of 0.325 there is no more noise:
![screenshot from 2015-09-24 15-15-23](https://cloud.githubusercontent.com/assets/302469/10084057/625ef4fe-62cf-11e5-896d-513b43829e6f.png)

With threshold of 0.125, it seems okay, but not _great_:
![screenshot from 2015-09-24 15-19-20](https://cloud.githubusercontent.com/assets/302469/10084118/bff1bf16-62cf-11e5-8d76-698b212b4545.png)

With threshold of 0.0, it appears a bit blocky:
![screenshot from 2015-09-24 15-16-37](https://cloud.githubusercontent.com/assets/302469/10084073/71a63ddc-62cf-11e5-83bb-f929b4794a78.png)
but I'm not sure if that's expected due to the 

Also, the colours are a bit random; here it is in mostly blue:
![screenshot from 2015-09-24 15-22-20](https://cloud.githubusercontent.com/assets/302469/10084180/193f1f64-62d0-11e5-9d89-1720761488b0.png)

These results are as expected. It's CT data, which is inherently rather noisy. Especially with a threshold that's around the background intensity values, you'd expect to get these blocky structures. The color is probably due to the currently set colormap?

Do you want to make a PR for the `gl_Fragcolor`, or shall I?


Resolving patch:
diff --git a/vispy/visuals/volume.py b/vispy/visuals/volume.py
--- a/vispy/visuals/volume.py
+++ b/vispy/visuals/volume.py
@@ -335,6 +335,7 @@
     before_loop="""
         vec4 color3 = vec4(0.0);  // final color
         vec3 dstep = 1.5 / u_shape;  // step to sample derivative
+        gl_FragColor = vec4(0.0);
     """,
     in_loop="""
         if (val > u_threshold-0.2) {


Test patch: