Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated iso and mip shaders from OpenSceneGraph-Data.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14358 16af8721-9629-0410-8352-f15c8da7e697
  • Loading branch information...
commit 9fbc1ea102f04710c9e70031d6041c63a199ae70 1 parent 14e10cf
Robert OSFIELD authored
4 src/osgVolume/Shaders/volume_accumulateSamples_iso_frag.cpp
View
@@ -3,7 +3,7 @@ char volume_accumulateSamples_iso_frag[] = "#version 110\n"
"uniform sampler3D volumeTexture;\n"
"\n"
"uniform float IsoSurfaceValue;\n"
- "\n"
+ "uniform float TransparencyValue;\n"
"varying vec3 lightDirection;\n"
"\n"
"vec4 accumulateSamples(vec4 fragColor, vec3 ts, vec3 te, vec3 dt, float scale, float cutoff, int num_iterations)\n"
@@ -29,7 +29,7 @@ char volume_accumulateSamples_iso_frag[] = "#version 110\n"
" float r = (targetValue-color.a)/(previousColor.a-color.a);\n"
" texcoord = texcoord - r*dt;\n"
"\n"
- " color.r = vec4(1.0, 1.0, 1.0, 1.0);\n"
+ " color.rgba = vec4(1.0, 1.0, 1.0, 1.0);\n"
"\n"
" float px = texture3D( volumeTexture, texcoord + deltaX).a;\n"
" float py = texture3D( volumeTexture, texcoord + deltaY).a;\n"
6 src/osgVolume/Shaders/volume_accumulateSamples_mip_frag.cpp
View
@@ -1,6 +1,8 @@
char volume_accumulateSamples_mip_frag[] = "#version 110\n"
"\n"
"uniform sampler3D volumeTexture;\n"
+ "uniform float TransparencyValue;\n"
+ "uniform float AlphaFuncValue;\n"
"\n"
"vec4 accumulateSamples(vec4 fragColor, vec3 ts, vec3 te, vec3 dt, float scale, float cutoff, int num_iterations)\n"
"{\n"
@@ -10,7 +12,7 @@ char volume_accumulateSamples_mip_frag[] = "#version 110\n"
" {\n"
" vec4 color = texture3D( volumeTexture, texcoord);\n"
"\n"
- " if (colorcolor.a>AlphaFuncValue && color.a>fragColor.a)\n"
+ " if (color.a>AlphaFuncValue && color.a>fragColor.a)\n"
" {\n"
" fragColor = color;\n"
" }\n"
@@ -20,6 +22,8 @@ char volume_accumulateSamples_mip_frag[] = "#version 110\n"
" --num_iterations;\n"
" }\n"
"\n"
+ " fragColor.a *= TransparencyValue;\n"
+ "\n"
" return fragColor;\n"
"}\n"
"\n";
Please sign in to comment.
Something went wrong with that request. Please try again.