summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
new file mode 100644
index 0000000000..ef823c28b1
--- /dev/null
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -0,0 +1,30 @@
+/**
+ * @file objectSkinV.glsl
+ *
+ * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc.
+ * $License$
+ */
+
+#version 120
+
+attribute vec4 object_weight;
+
+uniform mat4 matrixPalette[32];
+
+mat4 getObjectSkinnedTransform()
+{
+ int i;
+
+ vec4 w = fract(object_weight);
+ vec4 index = floor(object_weight);
+
+ float scale = 1.0/(w.x+w.y+w.z+w.w);
+ w *= scale;
+
+ mat4 mat = matrixPalette[int(index.x)]*w.x;
+ mat += matrixPalette[int(index.y)]*w.y;
+ mat += matrixPalette[int(index.z)]*w.z;
+ mat += matrixPalette[int(index.w)]*w.w;
+
+ return mat;
+}