Merged shaders from svn/trunk that refactor the workaround to the NVidia driver bug

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.4@15111 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-08-12 10:19:15 +00:00
parent 9975e15a97
commit b92c3f1455
8 changed files with 32 additions and 40 deletions

View File

@ -71,13 +71,12 @@ char volume_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"

View File

@ -71,13 +71,12 @@ char volume_iso_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = te.xyz;\n"

View File

@ -71,13 +71,12 @@ char volume_lit_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"

View File

@ -78,13 +78,12 @@ char volume_lit_tf_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"

View File

@ -70,13 +70,12 @@ char volume_mip_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"

View File

@ -75,13 +75,12 @@ char volume_tf_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"

View File

@ -76,13 +76,12 @@ char volume_tf_iso_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = te.xyz;\n"

View File

@ -75,13 +75,12 @@ char volume_tf_mip_frag[] = "#version 110\n"
"\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
"\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" if (num_iterations!=num_iterations) num_iterations = min_iteratrions;\n"
" #endif\n"
"\n"
" if (num_iterations<min_iteratrions) num_iterations = min_iteratrions;\n"
" else if (num_iterations>max_iteratrions) num_iterations = max_iteratrions;\n"
" #ifdef NVIDIA_Corporation\n"
" // Recent NVidia drivers have a bug in length() where it throws nan for some values of input into length() so catch these\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iteratrions;\n"
" #endif\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"