Compare commits

...

8 Commits

Author SHA1 Message Date
Robert Osfield
9c384664af Updated ChangeLog
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15107 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 10:04:33 +00:00
Robert Osfield
c1f083a67e Revised shaders to catch NVidia length bug that generates NAN's
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15105 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 08:34:57 +00:00
Robert Osfield
23d582fef5 Updated version and ChangeLog for release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15104 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 07:41:40 +00:00
Robert Osfield
074d470fa5 Updated version number for 3.2.3 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15103 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 07:38:17 +00:00
Robert Osfield
ee71c5a63f Updated AUTHORS, ChangeLog and README for 3.2.3 release
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15102 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 07:37:39 +00:00
Robert Osfield
fc77489239 Merged Contributors list from svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15101 16af8721-9629-0410-8352-f15c8da7e697
2015-08-12 06:50:35 +00:00
Robert Osfield
6fa7dd27f3 From Glenn Waldron, fix error in ZIP plugin handling of memory buffer
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15066 16af8721-9629-0410-8352-f15c8da7e697
2015-08-08 08:49:33 +00:00
Robert Osfield
32366f0489 Updated RayTracedTechnique shaders from svn/trunk.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@15058 16af8721-9629-0410-8352-f15c8da7e697
2015-08-06 10:09:18 +00:00
15 changed files with 160 additions and 102 deletions

View File

@@ -69,12 +69,12 @@ Torben Dannhauer
Sherman Wilcox
Robert Michael
Mourad Boufarguine
Glenn Waldron
Andr<EFBFBD> Garneau
Adrian Egli
Ruben Lopez
Randall Hopper
Jan Ciger
Glenn Waldron
Gideon May
Don Tidrow
Stephane Lamoliatte

View File

@@ -53,7 +53,7 @@ PROJECT(OpenSceneGraph)
SET(OPENSCENEGRAPH_MAJOR_VERSION 3)
SET(OPENSCENEGRAPH_MINOR_VERSION 2)
SET(OPENSCENEGRAPH_PATCH_VERSION 2)
SET(OPENSCENEGRAPH_PATCH_VERSION 3)
SET(OPENSCENEGRAPH_SOVERSION 100)
# set to 0 when not a release candidate, non zero means that any generated

View File

@@ -1,3 +1,68 @@
2015-08-12 08:34 robert
* src/osgVolume/Shaders/volume_frag.cpp,
src/osgVolume/Shaders/volume_iso_frag.cpp,
src/osgVolume/Shaders/volume_lit_frag.cpp,
src/osgVolume/Shaders/volume_lit_tf_frag.cpp,
src/osgVolume/Shaders/volume_mip_frag.cpp,
src/osgVolume/Shaders/volume_tf_frag.cpp,
src/osgVolume/Shaders/volume_tf_iso_frag.cpp,
src/osgVolume/Shaders/volume_tf_mip_frag.cpp: Revised shaders to
catch NVidia length bug that generates NAN's
2015-08-12 07:41 robert
* ChangeLog, include/osg/Version: Updated version and ChangeLog for
release
2015-08-12 07:38 robert
* CMakeLists.txt: Updated version number for 3.2.3 release
2015-08-12 07:37 robert
* AUTHORS.txt, ChangeLog, README.txt: Updated AUTHORS, ChangeLog
and README for 3.2.3 release
2015-08-12 06:50 robert
* applications/osgversion/Contributors.cpp: Merged Contributors
list from svn/trunk.
2015-08-08 08:49 robert
* src/osgPlugins/zip/ZipArchive.cpp: From Glenn Waldron, fix error
in ZIP plugin handling of memory buffer
2015-08-06 10:09 robert
* src/osgVolume/Shaders/volume_frag.cpp,
src/osgVolume/Shaders/volume_iso_frag.cpp,
src/osgVolume/Shaders/volume_lit_frag.cpp,
src/osgVolume/Shaders/volume_lit_tf_frag.cpp,
src/osgVolume/Shaders/volume_mip_frag.cpp,
src/osgVolume/Shaders/volume_tf_frag.cpp,
src/osgVolume/Shaders/volume_tf_iso_frag.cpp,
src/osgVolume/Shaders/volume_tf_mip_frag.cpp: Updated
RayTracedTechnique shaders from svn/trunk.
2015-08-04 15:52 robert
* CMakeLists.txt, NEWS.txt: Updated version and NEWS for 3.2.2
stable release
2015-08-04 10:37 robert
* NEWS.txt: Update NEWS to online Contributors list.
2015-08-04 10:26 robert
* AUTHORS.txt: Updated AUTHORS
2015-08-04 10:25 robert
* ChangeLog, NEWS.txt: Updated ChangeLog and NEWS for 3.2.2 release
2015-08-04 10:11 robert
* CMakeLists.txt: Upated rc number to 4

View File

@@ -23,7 +23,7 @@ more indepth instructions.
Robert Osfield.
Project Lead.
4th July 2014.
12th August 2015.
--

View File

@@ -260,7 +260,8 @@ const char* invalidNames[] =
"PushStackValueVisitor",
"RayIntersector",
"OpenSceneGraph-Data",
"Node"
"Node",
"AlphaFunc"
};
@@ -481,7 +482,9 @@ TypoCorrection typoCorrections[] =
{"Ravsel", "Rav<EFBFBD>elj"},
{"Ravselj", "Rav<EFBFBD>elj"},
{"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"}
{"Viganò", "Vigan<EFBFBD>"},
{"Vigano", "Vigan<EFBFBD>"},
{"Frashud", "Farshid"}
};
@@ -662,7 +665,15 @@ NameCorrection nameCorrections[] =
{"Bradley", "Baker",
"Bradley", "Baker Searles"},
{"PawelKsiezopolski", "",
"Pawel", "Ksiezopolski"}
"Pawel", "Ksiezopolski"},
{"Albert", "Luaces",
"Alberto","Luaces"},
{"KOS", "",
"Konstantin","Matveyev"},
{"WeSee", "",
"Alois", "Wismer"},
{"We", "See",
"Alois", "Wismer"}
};

View File

@@ -20,7 +20,7 @@ extern "C" {
#define OPENSCENEGRAPH_MAJOR_VERSION 3
#define OPENSCENEGRAPH_MINOR_VERSION 2
#define OPENSCENEGRAPH_PATCH_VERSION 2
#define OPENSCENEGRAPH_PATCH_VERSION 3
#define OPENSCENEGRAPH_SOVERSION 100
/* Convenience macro that can be used to decide whether a feature is present or not i.e.

View File

@@ -641,7 +641,7 @@ ZipArchive::getDataNoLock() const
{
data._zipHandle = OpenZip( _filename.c_str(), _password.c_str() );
}
else if ( _membuffer.empty() )
else if ( !_membuffer.empty() )
{
data._zipHandle = OpenZip( (void*)_membuffer.c_str(), _membuffer.length(), _password.c_str() );
}

View File

@@ -9,7 +9,7 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -61,19 +61,17 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\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"
" {\n"
" vec4 color = texture3D( baseTexture, texcoord);\n"
@@ -88,7 +86,7 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"
@@ -99,7 +97,6 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
" fragColor *= baseColor;\n"
"\n"
" if (fragColor.w<AlphaFuncValue) discard;\n"
" \n"
" gl_FragColor = fragColor;\n"
"}\n"
"\n";

View File

@@ -10,7 +10,7 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -62,16 +62,14 @@ char volume_iso_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(t0-te).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = te.xyz;\n"
"\n"
" vec4 previousColor = texture3D( baseTexture, texcoord);\n"

View File

@@ -10,7 +10,7 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -62,16 +62,14 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"
"\n"
" float normalSampleDistance = 1.0/512.0;\n"
@@ -115,18 +113,17 @@ char volume_lit_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"
"\n"
" fragColor.w *= TransparencyValue;\n"
" if (fragColor.w>1.0) fragColor.w = 1.0; \n"
" if (fragColor.w>1.0) fragColor.w = 1.0;\n"
"\n"
" fragColor *= baseColor;\n"
"\n"
" if (fragColor.w<AlphaFuncValue) discard;\n"
" \n"
" gl_FragColor = fragColor;\n"
"}\n"
"\n";

View File

@@ -15,7 +15,7 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -69,16 +69,14 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
"\n"
" vec3 eyeDirection = normalize((te-t0).xyz);\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"
"\n"
" float normalSampleDistance = 1.0/512.0;\n"
@@ -112,7 +110,6 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
" color.z *= lightScale;\n"
" }\n"
"\n"
"\n"
" float r = color[3]*TransparencyValue;\n"
" if (r>AlphaFuncValue)\n"
" {\n"
@@ -124,7 +121,7 @@ char volume_lit_tf_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"

View File

@@ -9,7 +9,7 @@ char volume_mip_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -61,19 +61,17 @@ char volume_mip_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\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"
" {\n"
" vec4 color = texture3D( baseTexture, texcoord);\n"
@@ -81,18 +79,17 @@ char volume_mip_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"
"\n"
" fragColor.w *= TransparencyValue;\n"
" if (fragColor.w>1.0) fragColor.w = 1.0; \n"
" if (fragColor.w>1.0) fragColor.w = 1.0;\n"
"\n"
" fragColor *= baseColor;\n"
"\n"
" if (fragColor.w<AlphaFuncValue) discard;\n"
" \n"
" gl_FragColor = fragColor;\n"
"}\n"
"\n";

View File

@@ -14,7 +14,7 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -66,19 +66,17 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\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"
" {\n"
" float v = texture3D( baseTexture, texcoord).a * tfScale + tfOffset;\n"
@@ -95,7 +93,7 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"
@@ -106,7 +104,6 @@ char volume_tf_frag[] = "uniform sampler3D baseTexture;\n"
" fragColor *= baseColor;\n"
"\n"
" if (fragColor.w<AlphaFuncValue) discard;\n"
" \n"
" gl_FragColor = fragColor;\n"
"}\n"
"\n";

View File

@@ -15,7 +15,7 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
@@ -67,14 +67,13 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" if (num_iterations>max_iteratrions)\n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
"\n"
" vec3 deltaTexCoord=(t0-te).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = te.xyz;\n"
@@ -84,7 +83,7 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
" vec3 deltaX = vec3(normalSampleDistance, 0.0, 0.0);\n"
" vec3 deltaY = vec3(0.0, normalSampleDistance, 0.0);\n"
" vec3 deltaZ = vec3(0.0, 0.0, normalSampleDistance);\n"
"\n"
" \n"
" while(num_iterations>0.0)\n"
" {\n"
"\n"
@@ -134,6 +133,5 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
"\n"
" // we didn't find an intersection so just discard fragment\n"
" discard;\n"
"\n"
"}\n"
"\n";

View File

@@ -14,9 +14,9 @@ char volume_tf_mip_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n"
"\n"
"void main(void)\n"
"{ \n"
" vec3 t0 = (texgen * vertexPos).xyz;\n"
" vec3 te = (texgen * cameraPos).xyz;\n"
"{\n"
" vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n"
"\n"
" if (te.x>=0.0 && te.x<=1.0 &&\n"
" te.y>=0.0 && te.y<=1.0 &&\n"
@@ -63,19 +63,20 @@ char volume_tf_mip_frag[] = "uniform sampler3D baseTexture;\n"
" }\n"
" }\n"
"\n"
" const float max_iteratrions = 2048.0;\n"
" float num_iterations = ceil(length(te-t0)/SampleDensityValue);\n"
" if (num_iterations<2.0) num_iterations = 2.0;\n"
" \n"
" if (num_iterations>max_iteratrions) \n"
" {\n"
" num_iterations = max_iteratrions;\n"
" }\n"
" t0 = t0 * texgen;\n"
" te = te * texgen;\n"
"\n"
" vec3 deltaTexCoord=(te-t0)/float(num_iterations-1.0);\n"
" vec3 texcoord = t0;\n"
" const float min_iterations = 2.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n"
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0); \n"
" vec3 deltaTexCoord=(te-t0).xyz/float(num_iterations-1.0);\n"
" vec3 texcoord = t0.xyz;\n"
"\n"
" vec4 fragColor = vec4(0.0, 0.0, 0.0, 0.0);\n"
" while(num_iterations>0.0)\n"
" {\n"
" float v = texture3D( baseTexture, texcoord).s * tfScale + tfOffset;\n"
@@ -84,7 +85,7 @@ char volume_tf_mip_frag[] = "uniform sampler3D baseTexture;\n"
" {\n"
" fragColor = color;\n"
" }\n"
" texcoord += deltaTexCoord; \n"
" texcoord += deltaTexCoord;\n"
"\n"
" --num_iterations;\n"
" }\n"