Compare commits

..

1 Commits

Author SHA1 Message Date
Robert Osfield
07d2adec5c Release OpenSceneGraph-3.2.2
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.2.2@15052 16af8721-9629-0410-8352-f15c8da7e697
2015-08-04 16:03:33 +00:00
15 changed files with 102 additions and 160 deletions

View File

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

View File

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

View File

@@ -1,68 +1,3 @@
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 2015-08-04 10:11 robert
* CMakeLists.txt: Upated rc number to 4 * CMakeLists.txt: Upated rc number to 4

View File

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

View File

@@ -260,8 +260,7 @@ const char* invalidNames[] =
"PushStackValueVisitor", "PushStackValueVisitor",
"RayIntersector", "RayIntersector",
"OpenSceneGraph-Data", "OpenSceneGraph-Data",
"Node", "Node"
"AlphaFunc"
}; };
@@ -482,9 +481,7 @@ TypoCorrection typoCorrections[] =
{"Ravsel", "Rav<EFBFBD>elj"}, {"Ravsel", "Rav<EFBFBD>elj"},
{"Ravselj", "Rav<EFBFBD>elj"}, {"Ravselj", "Rav<EFBFBD>elj"},
{"Janik", "Jannik"}, {"Janik", "Jannik"},
{"Viganò", "Vigan<EFBFBD>"}, {"Viganò", "Vigan<EFBFBD>"}
{"Vigano", "Vigan<EFBFBD>"},
{"Frashud", "Farshid"}
}; };
@@ -665,15 +662,7 @@ NameCorrection nameCorrections[] =
{"Bradley", "Baker", {"Bradley", "Baker",
"Bradley", "Baker Searles"}, "Bradley", "Baker Searles"},
{"PawelKsiezopolski", "", {"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_MAJOR_VERSION 3
#define OPENSCENEGRAPH_MINOR_VERSION 2 #define OPENSCENEGRAPH_MINOR_VERSION 2
#define OPENSCENEGRAPH_PATCH_VERSION 3 #define OPENSCENEGRAPH_PATCH_VERSION 2
#define OPENSCENEGRAPH_SOVERSION 100 #define OPENSCENEGRAPH_SOVERSION 100
/* Convenience macro that can be used to decide whether a feature is present or not i.e. /* 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() ); 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() ); 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" "varying vec4 baseColor;\n"
"\n" "\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{ \n"
" vec4 t0 = vertexPos;\n" " vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n" " vec4 te = cameraPos;\n"
"\n" "\n"
@@ -61,17 +61,19 @@ 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 min_iterations = 2.0;\n" " const float max_iteratrions = 2048.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n" " if (num_iterations<2.0) num_iterations = 2.0;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\n"
"\n" "\n"
" vec3 deltaTexCoord=(te-t0).xyz/(num_iterations-1.0);\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 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.0)\n"
" {\n" " {\n"
" vec4 color = texture3D( baseTexture, texcoord);\n" " vec4 color = texture3D( baseTexture, texcoord);\n"
@@ -86,7 +88,7 @@ char volume_frag[] = "uniform sampler3D baseTexture;\n"
" {\n" " {\n"
" fragColor = color;\n" " fragColor = color;\n"
" }\n" " }\n"
" texcoord += deltaTexCoord;\n" " texcoord += deltaTexCoord; \n"
"\n" "\n"
" --num_iterations;\n" " --num_iterations;\n"
" }\n" " }\n"
@@ -97,6 +99,7 @@ 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";

View File

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

View File

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

View File

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

View File

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

View File

@@ -15,7 +15,7 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
"varying vec4 baseColor;\n" "varying vec4 baseColor;\n"
"\n" "\n"
"void main(void)\n" "void main(void)\n"
"{\n" "{ \n"
" vec4 t0 = vertexPos;\n" " vec4 t0 = vertexPos;\n"
" vec4 te = cameraPos;\n" " vec4 te = cameraPos;\n"
"\n" "\n"
@@ -67,13 +67,14 @@ 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 min_iterations = 2.0;\n" " const float max_iteratrions = 2048.0;\n"
" const float max_iterations = 2048.0;\n"
" float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n" " float num_iterations = ceil(length((te-t0).xyz)/SampleDensityValue);\n"
" if (num_iterations<min_iterations) num_iterations = min_iterations;\n" " if (num_iterations<2.0) num_iterations = 2.0;\n"
" else if (num_iterations>max_iterations) num_iterations = max_iterations;\n"
" else if (num_iterations!=num_iterations) num_iterations = max_iterations;\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.0);\n"
" vec3 texcoord = te.xyz;\n" " vec3 texcoord = te.xyz;\n"
@@ -83,7 +84,7 @@ char volume_tf_iso_frag[] = "uniform sampler3D baseTexture;\n"
" vec3 deltaX = vec3(normalSampleDistance, 0.0, 0.0);\n" " vec3 deltaX = vec3(normalSampleDistance, 0.0, 0.0);\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.0)\n"
" {\n" " {\n"
"\n" "\n"
@@ -133,5 +134,6 @@ 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";

View File

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