diff --git a/src/osgVolume/Shaders/volume_iso_frag.cpp b/src/osgVolume/Shaders/volume_iso_frag.cpp index fbfb3c98b..7f0084b87 100644 --- a/src/osgVolume/Shaders/volume_iso_frag.cpp +++ b/src/osgVolume/Shaders/volume_iso_frag.cpp @@ -117,7 +117,10 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n" "\n" " fragColor = vec4(lightScale, lightScale, lightScale, 1.0);\n" " \n" - " break;\n" + " if (fragColor.w>1.0) fragColor.w = 1.0; \n" + " gl_FragColor = fragColor;\n" + " \n" + " return;\n" " }\n" " \n" " previousColor = color;\n" @@ -127,7 +130,9 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n" " --num_iterations;\n" " }\n" "\n" - " if (fragColor.w>1.0) fragColor.w = 1.0; \n" - " gl_FragColor = fragColor;\n" + " // we didn't find an intersection so just discard fragment\n" + " discard;\n" + "\n" "}\n" + ";\n" "\n";