Index: SimGear/simgear/scene/sky/CloudShaderGeometry.cxx
===================================================================
--- SimGear/simgear/scene/sky/CloudShaderGeometry.cxx	(revision 5)
+++ SimGear/simgear/scene/sky/CloudShaderGeometry.cxx	(working copy)
@@ -93,12 +93,19 @@
 
     for(CloudSpriteList::const_iterator t = _cloudsprites.begin(); t != _cloudsprites.end(); ++t)
     {
+#ifdef CSG_PACKED_ATTRIBS
+      GLfloat ua1[3] = { (GLfloat) (*t)->texture_index_x/varieties_x, (GLfloat) (*t)->texture_index_y/varieties_y, (*t)->width };
+      GLfloat ua2[3] = { (GLfloat) (*t)->height, (*t)->shade, (GLfloat) (*t)->cloud_height };
+        extensions->glVertexAttrib3fv(USR_ATTR_1, ua1 );
+        extensions->glVertexAttrib3fv(USR_ATTR_2, ua2 );
+#else
         extensions->glVertexAttrib1f(TEXTURE_INDEX_X, (GLfloat) (*t)->texture_index_x/varieties_x);
         extensions->glVertexAttrib1f(TEXTURE_INDEX_Y, (GLfloat) (*t)->texture_index_y/varieties_y);
         extensions->glVertexAttrib1f(WIDTH, (GLfloat) (*t)->width);
         extensions->glVertexAttrib1f(HEIGHT, (GLfloat) (*t)->height);
         extensions->glVertexAttrib1f(SHADE, (GLfloat) (*t)->shade);
         extensions->glVertexAttrib1f(CLOUD_HEIGHT, (GLfloat) (*t)->cloud_height);
+#endif
         glColor4f((*t)->position.x(), (*t)->position.y(), (*t)->position.z(), 1.0);
         _geometry->draw(renderInfo);
     }
Index: SimGear/simgear/scene/sky/CloudShaderGeometry.hxx
===================================================================
--- SimGear/simgear/scene/sky/CloudShaderGeometry.hxx	(revision 5)
+++ SimGear/simgear/scene/sky/CloudShaderGeometry.hxx	(working copy)
@@ -34,7 +34,7 @@
 
 #include <simgear/math/SGMath.hxx>
 
-
+#define CSG_PACKED_ATTRIBS
 namespace simgear
 {
 
@@ -42,13 +42,17 @@
 {
     public:
         
+#ifdef CSG_PACKED_ATTRIBS
+        const static unsigned int USR_ATTR_1 = 10;
+        const static unsigned int USR_ATTR_2 = 11;
+#else
         const static unsigned int CLOUD_HEIGHT = 10;
         const static unsigned int TEXTURE_INDEX_X = 11;
         const static unsigned int TEXTURE_INDEX_Y = 12;
         const static unsigned int WIDTH = 13;
         const static unsigned int HEIGHT = 14;
         const static unsigned int SHADE = 15;
-        
+#endif        
         CloudShaderGeometry()
         { 
             setUseDisplayList(false); 
Index: SimGear/simgear/scene/sky/newcloud.cxx
===================================================================
--- SimGear/simgear/scene/sky/newcloud.cxx	(revision 5)
+++ SimGear/simgear/scene/sky/newcloud.cxx	(working copy)
@@ -65,12 +65,23 @@
     "#version 120\n"
     "\n"
     "varying float fogFactor;\n"
+#ifdef CSG_PACKED_ATTRIBS
+    "attribute vec3 usrAttr1;\n"
+    "attribute vec3 usrAttr2;\n"
+    "float textureIndexX = usrAttr1.r;\n"
+    "float textureIndexY = usrAttr1.g;\n"
+    "float wScale = usrAttr1.b;\n"
+    "float hScale = usrAttr2.r;\n"
+    "float shade = usrAttr2.g;\n"
+    "float cloud_height = usrAttr2.b;\n"
+#else
     "attribute float textureIndexX;\n"
     "attribute float textureIndexY;\n"
     "attribute float wScale;\n"
     "attribute float hScale;\n"
     "attribute float shade;\n"
     "attribute float cloud_height;\n"
+#endif
     "void main(void)\n"
     "{\n"
     "  gl_TexCoord[0] = gl_MultiTexCoord0 + vec4(textureIndexX, textureIndexY, 0.0, 0.0);\n"
@@ -206,13 +217,17 @@
             baseTextureSampler = new osg::Uniform("baseTexture", 0);
             Shader* vertex_shader = new Shader(Shader::VERTEX, vertexShaderSource);
             program->addShader(vertex_shader);
+#ifdef CSG_PACKED_ATTRIBS
+            program->addBindAttribLocation("usrAttr1", CloudShaderGeometry::USR_ATTR_1);
+            program->addBindAttribLocation("usrAttr2", CloudShaderGeometry::USR_ATTR_2);
+#else
             program->addBindAttribLocation("textureIndexX", CloudShaderGeometry::TEXTURE_INDEX_X);
             program->addBindAttribLocation("textureIndexY", CloudShaderGeometry::TEXTURE_INDEX_Y);
             program->addBindAttribLocation("wScale", CloudShaderGeometry::WIDTH);
             program->addBindAttribLocation("hScale", CloudShaderGeometry::HEIGHT);
             program->addBindAttribLocation("shade", CloudShaderGeometry::SHADE);
             program->addBindAttribLocation("cloud_height", CloudShaderGeometry::CLOUD_HEIGHT);
-                  
+#endif                  
             Shader* fragment_shader = new Shader(Shader::FRAGMENT, fragmentShaderSource);
             program->addShader(fragment_shader);
             material = new Material;
