Updated shaders from OpenSceneGraph-Data.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15059 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
parent
687e77ddc9
commit
d205919881
@ -61,20 +61,16 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
||||||
" float r = color[3]*TransparencyValue;\n"
|
" float r = color[3]*TransparencyValue;\n"
|
||||||
@ -99,7 +95,6 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" fragColor *= baseColor;\n"
|
" fragColor *= baseColor;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
||||||
" \n"
|
|
||||||
" gl_FragColor = fragColor;\n"
|
" gl_FragColor = fragColor;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
@ -62,16 +62,13 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
|
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1);\n"
|
||||||
" vec3 texcoord = te.xyz;\n"
|
" vec3 texcoord = te.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 previousColor = texture3D( baseTexture, texcoord);\n"
|
" vec4 previousColor = texture3D( baseTexture, texcoord);\n"
|
||||||
@ -81,7 +78,7 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n"
|
" vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n"
|
||||||
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
||||||
" \n"
|
" \n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
@ -62,16 +62,12 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" float normalSampleDistance = 1.0/512.0;\n"
|
" float normalSampleDistance = 1.0/512.0;\n"
|
||||||
@ -80,7 +76,7 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -126,7 +122,6 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" fragColor *= baseColor;\n"
|
" fragColor *= baseColor;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
||||||
" \n"
|
|
||||||
" gl_FragColor = fragColor;\n"
|
" gl_FragColor = fragColor;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
@ -69,16 +69,12 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
"\n"
|
"\n"
|
||||||
" vec3 eyeDirection = normalize((te-t0).xyz);\n"
|
" vec3 eyeDirection = normalize((te-t0).xyz);\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" float normalSampleDistance = 1.0/512.0;\n"
|
" float normalSampleDistance = 1.0/512.0;\n"
|
||||||
@ -87,7 +83,7 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n"
|
" float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n"
|
||||||
" vec4 color = texture1D( tfTexture, v);\n"
|
" vec4 color = texture1D( tfTexture, v);\n"
|
||||||
@ -112,7 +108,6 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" color.z *= lightScale;\n"
|
" color.z *= lightScale;\n"
|
||||||
" }\n"
|
" }\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\n"
|
|
||||||
" float r = color[3]*TransparencyValue;\n"
|
" float r = color[3]*TransparencyValue;\n"
|
||||||
" if (r>AlphaFuncValue)\n"
|
" if (r>AlphaFuncValue)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
|
@ -61,20 +61,16 @@ char volume_mip_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
" vec4 color = texture3D( baseTexture, texcoord);\n"
|
||||||
" if (fragColor.w<color.w)\n"
|
" if (fragColor.w<color.w)\n"
|
||||||
@ -92,7 +88,6 @@ char volume_mip_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" fragColor *= baseColor;\n"
|
" fragColor *= baseColor;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
||||||
" \n"
|
|
||||||
" gl_FragColor = fragColor;\n"
|
" gl_FragColor = fragColor;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
@ -66,20 +66,16 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions) \n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n"
|
" float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n"
|
||||||
" vec4 color = texture1D( tfTexture, v);\n"
|
" vec4 color = texture1D( tfTexture, v);\n"
|
||||||
@ -106,7 +102,6 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" fragColor *= baseColor;\n"
|
" fragColor *= baseColor;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
" if (fragColor.w<AlphaFuncValue) discard;\n"
|
||||||
" \n"
|
|
||||||
" gl_FragColor = fragColor;\n"
|
" gl_FragColor = fragColor;\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
@ -67,16 +67,13 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions)\n"
|
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
"\n"
|
||||||
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
|
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1);\n"
|
||||||
" vec3 texcoord = te.xyz;\n"
|
" vec3 texcoord = te.xyz;\n"
|
||||||
" float previousV = texture3D( baseTexture, texcoord).a;\n"
|
" float previousV = texture3D( baseTexture, texcoord).a;\n"
|
||||||
"\n"
|
"\n"
|
||||||
@ -85,7 +82,7 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n"
|
" vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n"
|
||||||
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
|
||||||
" \n"
|
" \n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
"\n"
|
"\n"
|
||||||
" float v = texture3D( baseTexture, texcoord).a;\n"
|
" float v = texture3D( baseTexture, texcoord).a;\n"
|
||||||
@ -134,6 +131,5 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
"\n"
|
"\n"
|
||||||
" // we didn't find an intersection so just discard fragment\n"
|
" // we didn't find an intersection so just discard fragment\n"
|
||||||
" discard;\n"
|
" discard;\n"
|
||||||
"\n"
|
|
||||||
"}\n"
|
"}\n"
|
||||||
"\n";
|
"\n";
|
||||||
|
@ -66,20 +66,16 @@ char volume_tf_mip_frag[] = "uniform sampler3D baseTexture;\n"
|
|||||||
" t0 = t0 * texgen;\n"
|
" t0 = t0 * texgen;\n"
|
||||||
" te = te * texgen;\n"
|
" te = te * texgen;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" const float max_iteratrions = 2048.0;\n"
|
" const int max_iteratrions = 2048;\n"
|
||||||
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
" int num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
|
||||||
" if (num_iterations<2.0) num_iterations = 2.0;\n"
|
" if (num_iterations<2) num_iterations = 2;\n"
|
||||||
|
" if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" if (num_iterations>max_iteratrions)\n"
|
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1);\n"
|
||||||
" {\n"
|
|
||||||
" num_iterations = max_iteratrions;\n"
|
|
||||||
" }\n"
|
|
||||||
"\n"
|
|
||||||
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
|
|
||||||
" vec3 texcoord = t0.xyz;\n"
|
" vec3 texcoord = t0.xyz;\n"
|
||||||
"\n"
|
"\n"
|
||||||
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
|
||||||
" while(num_iterations>0.0)\n"
|
" while(num_iterations>0)\n"
|
||||||
" {\n"
|
" {\n"
|
||||||
" float v = texture3D( baseTexture, texcoord).s * tfScale + tfOffset;\n"
|
" float v = texture3D( baseTexture, texcoord).s * tfScale + tfOffset;\n"
|
||||||
" vec4 color = texture1D( tfTexture, v);\n"
|
" vec4 color = texture1D( tfTexture, v);\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user