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:
@@ -1416,6 +1416,7 @@ Vec4 _readColor(GLenum pixelFormat, T* data,float scale)
|
||||
{
|
||||
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); }
|
||||
case(GL_LUMINANCE_ALPHA): { float l = float(*data++)*scale; float a = float(*data++)*scale; return Vec4(l,l,l,a); }
|
||||
|
||||
Reference in New Issue
Block a user