From Terry Welsh, "As I mentioned here

http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg33967.html
, interpolating through HSV space gives a rainbow color effect which
does not mimic the simple RGB color interpolation that OpenGL does.
It's overkill and causes unexpected visual artifacts.  In the attached
files I've removed the conversion to HSV so that interpolation happens
in RGB space."
This commit is contained in:
Robert Osfield
2009-11-24 14:12:54 +00:00
parent 383a5222bd
commit 6d3e7f83e2
2 changed files with 17 additions and 250 deletions

View File

@@ -397,10 +397,8 @@ protected:
osg::Vec4 _colorGradientBottomRight;
osg::Vec4 _colorGradientTopRight;
// Helper functions for color interpolation
// Helper function for color interpolation
float bilinearInterpolate(float x1, float x2, float y1, float y2, float x, float y, float q11, float q12, float q21, float q22) const;
void convertHsvToRgb( float hsv[], float rgb[] ) const;
void convertRgbToHsv( float rgb[], float hsv[] ) const;
};
}