Index: /OpenSceneGraph/trunk/include/osg/Texture
===================================================================
--- /OpenSceneGraph/trunk/include/osg/Texture (revision 10833)
+++ /OpenSceneGraph/trunk/include/osg/Texture (revision 10934)
@@ -538,5 +538,6 @@
           * See http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow.txt. */
         void setShadowComparison(bool flag) { _use_shadow_comparison = flag; }
-
+        bool getShadowComparison() const { return _use_shadow_comparison; }
+        
         enum ShadowCompareFunc {
             NEVER = GL_NEVER,
Index: /OpenSceneGraph/trunk/src/osg/Image.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osg/Image.cpp (revision 10924)
+++ /OpenSceneGraph/trunk/src/osg/Image.cpp (revision 10934)
@@ -1417,4 +1417,5 @@
     switch(pixelFormat)
     {
+        case(GL_DEPTH_COMPONENT):   //intentionally fall through and execute the code for GL_LUMINANCE
         case(GL_LUMINANCE):         { float l = float(*data++)*scale; return Vec4(l, l, l, 1.0f); }
         case(GL_ALPHA):             { float a = float(*data++)*scale; return Vec4(1.0f, 1.0f, 1.0f, a); }
Index: /OpenSceneGraph/trunk/src/osgPlugins/tiff/ReaderWriterTIFF.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/tiff/ReaderWriterTIFF.cpp (revision 9556)
+++ /OpenSceneGraph/trunk/src/osgPlugins/tiff/ReaderWriterTIFF.cpp (revision 10934)
@@ -784,4 +784,5 @@
 
             switch(img.getPixelFormat()) {
+                case GL_DEPTH_COMPONENT:
                 case GL_LUMINANCE:
                 case GL_ALPHA:
Index: /OpenSceneGraph/trunk/src/osgPlugins/ive/Texture.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ive/Texture.cpp (revision 10762)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ive/Texture.cpp (revision 10934)
@@ -63,4 +63,11 @@
         out->writeInt(_sourceType);
     }
+
+    if( out->getVersion() >= VERSION_0043 )
+    {
+      out->writeBool( _use_shadow_comparison );
+      out->writeInt( _shadow_compare_func );
+      out->writeInt( _shadow_texture_mode );
+    }
 }
 
@@ -113,4 +120,11 @@
             _sourceType = in->readInt();
         }
+
+        if( in->getVersion() >= VERSION_0043 )
+        {
+          _use_shadow_comparison = in->readBool();
+          _shadow_compare_func = (osg::Texture::ShadowCompareFunc)in->readInt();
+          _shadow_texture_mode = (osg::Texture::ShadowTextureMode)in->readInt();
+        }
     }
     else
Index: /OpenSceneGraph/trunk/src/osgPlugins/ive/IveVersion.h
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/ive/IveVersion.h (revision 10513)
+++ /OpenSceneGraph/trunk/src/osgPlugins/ive/IveVersion.h (revision 10934)
@@ -52,6 +52,7 @@
 #define VERSION_0041 41
 #define VERSION_0042 42
+#define VERSION_0043 43
 
-#define VERSION VERSION_0042
+#define VERSION VERSION_0043
 
 /* The BYTE_SEX tag is used to check the endian
Index: /OpenSceneGraph/trunk/src/osgPlugins/osg/Texture.cpp
===================================================================
--- /OpenSceneGraph/trunk/src/osgPlugins/osg/Texture.cpp (revision 9475)
+++ /OpenSceneGraph/trunk/src/osgPlugins/osg/Texture.cpp (revision 10934)
@@ -27,4 +27,8 @@
 bool Texture_matchSourceTypeStr(const char* str,int& value);
 const char* Texture_getSourceTypeStr(int value);
+bool Texture_matchShadowCompareFuncStr(const char* str,Texture::ShadowCompareFunc& value);
+const char* Texture_getShadowCompareFuncStr(Texture::ShadowCompareFunc value);
+bool Texture_matchShadowTextureModeStr(const char* str,Texture::ShadowTextureMode& value);
+const char* Texture_getShadowTextureModeStr(Texture::ShadowTextureMode value);
 
 // register the read and write functions with the osgDB::Registry.
@@ -202,4 +206,42 @@
     }
 
+    if (fr[0].matchWord("shadowComparison"))
+    {
+        if (fr[1].matchWord("TRUE")) 
+        {
+            texture.setShadowComparison(true);
+            fr +=2 ;
+            iteratorAdvanced = true;
+        }
+        else if (fr[1].matchWord("FALSE")) 
+        {
+            texture.setShadowComparison(false);
+            fr +=2 ;
+            iteratorAdvanced = true;
+        }
+    }
+
+    if (fr[0].matchWord("shadowCompareFunc"))
+    {
+        Texture::ShadowCompareFunc value;
+        if (Texture_matchShadowCompareFuncStr(fr[1].getStr(),value))
+        {
+            texture.setShadowCompareFunc(value);
+            fr+=2;
+            iteratorAdvanced = true;
+        }
+    }
+
+    if (fr[0].matchWord("shadowTextureMode"))
+    {
+        Texture::ShadowTextureMode value;
+        if (Texture_matchShadowTextureModeStr(fr[1].getStr(),value))
+        {
+            texture.setShadowTextureMode(value);
+            fr+=2;
+            iteratorAdvanced = true;
+        }
+    }
+
     return iteratorAdvanced;
 }
@@ -254,4 +296,10 @@
 
     fw.indent() << "resizeNonPowerOfTwo "<< (texture.getResizeNonPowerOfTwoHint()?"TRUE":"FALSE") << std::endl;
+
+    fw.indent() << "shadowComparison "<< (texture.getShadowComparison()?"TRUE":"FALSE") << std::endl;
+
+    fw.indent() << "shadowCompareFunc " << Texture_getShadowCompareFuncStr(texture.getShadowCompareFunc()) << std::endl;
+
+    fw.indent() << "shadowTextureMode " << Texture_getShadowTextureModeStr(texture.getShadowTextureMode()) << std::endl;
 
     return true;
@@ -427,5 +475,4 @@
 }
 
-
 const char* Texture_getSourceTypeStr(int value)
 {
@@ -442,2 +489,42 @@
     return NULL;
 }
+
+bool Texture_matchShadowCompareFuncStr(const char* str, Texture::ShadowCompareFunc& value)
+{
+    if (     strcmp(str,"GL_LEQUAL")==0) value = Texture::LEQUAL;
+    else if (strcmp(str,"GL_GEQUAL")==0) value = Texture::GEQUAL;
+    else return false;
+
+    return true;
+}
+
+const char* Texture_getShadowCompareFuncStr(Texture::ShadowCompareFunc value)
+{
+    switch(value)
+    {
+    case( Texture::LEQUAL ): return "GL_LEQUAL";
+    case( Texture::GEQUAL ): return "GL_GEQUAL";
+    }
+    return NULL;
+}
+
+bool Texture_matchShadowTextureModeStr(const char* str,Texture::ShadowTextureMode& value)
+{
+    if (     strcmp(str,"GL_LUMINANCE")==0) value = Texture::LUMINANCE;
+    else if (strcmp(str,"GL_INTENSITY")==0) value = Texture::INTENSITY;
+    else if (strcmp(str,"GL_ALPHA")==0) value = Texture::ALPHA;
+    else return false;
+
+    return true;
+}
+
+const char* Texture_getShadowTextureModeStr(Texture::ShadowTextureMode value)
+{
+    switch(value)
+    {
+        case( Texture::LUMINANCE ): return "GL_LUMINANCE";
+        case( Texture::INTENSITY ): return "GL_INTENSITY";
+        case( Texture::ALPHA ): return "GL_ALPHA";
+    }
+    return NULL;
+}
