From Rob Radtke, "I recently ran into some issues trying to save/load a scene graph as a .ive file. The problems came about because the scene graph contained depth textures in it. I have attached a patch (against the current revision: 10919) that fixes the issues that I encountered. Both attachments contain the same patch--one is a .zip file that contains the modified files and the other is a text patch file. Here is a summary of the changes I made:

1) Add getShadowComparison() accessor function to osg::Texture class
2) Modify ReaderWriterTiff::writeTifStream() and _readColor() (in Image.cpp) to handle pixelFormat==GL_DEPTH_COMPONENT as if it were GL_LUMINANCE
3) Modify the Texture classes of the ive and osg plug-ins so that they save/load the following Texture members: _use_shadow_comparison, _shadow_compare_func and _shadow_texture_mode
"
This commit is contained in:
Robert Osfield
2010-01-08 11:32:55 +00:00
parent b68a035d43
commit a31aa512d7
6 changed files with 108 additions and 3 deletions

View File

@@ -537,7 +537,8 @@ class OSG_EXPORT Texture : public osg::StateAttribute
/** Sets GL_TEXTURE_COMPARE_MODE_ARB to GL_COMPARE_R_TO_TEXTURE_ARB
* 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,
LESS = GL_LESS,