summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2015-10-07 15:38:40 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2015-10-07 15:38:40 -0400
commit74b8a487646cccb3260d02910ab5b16e274ec9ab (patch)
treeb23fe3a169612535095e34fb5391323cc2e3bace /indra/newview/app_settings
parent4588616d0d57e744ec741ed17299c1c052d2bb55 (diff)
SL-234 WIP - adjust max mesh object joints at run-time, including rebuilding shaders
Diffstat (limited to 'indra/newview/app_settings')
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl10
2 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6533344048..dcb2764fe7 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6112,6 +6112,17 @@
<key>Value</key>
<real>1.6</real>
</map>
+ <key>MaxJointsPerMeshObject</key>
+ <map>
+ <key>Comment</key>
+ <string>Maximum joints per rigged mesh object</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <real>999</real>
+ </map>
<key>MaxPersistentNotifications</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
index b342abb7c1..8f754fe82b 100755
--- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl
@@ -27,8 +27,8 @@ ATTRIBUTE vec4 weight4;
/* BENTO JOINT COUNT LIMITS
* Note that the value in these two lines also needs to be updated to value-1 several places below.
*/
-uniform mat3 matrixPalette[152];
-uniform vec3 translationPalette[152];
+uniform mat3 matrixPalette[MAX_JOINTS_PER_MESH_OBJECT];
+uniform vec3 translationPalette[MAX_JOINTS_PER_MESH_OBJECT];
mat4 getObjectSkinnedTransform()
{
@@ -37,7 +37,7 @@ mat4 getObjectSkinnedTransform()
vec4 w = fract(weight4);
vec4 index = floor(weight4);
- index = min(index, vec4(151.0));
+ index = min(index, vec4(MAX_JOINTS_PER_MESH_OBJECT-1));
index = max(index, vec4( 0.0));
w *= 1.0/(w.x+w.y+w.z+w.w);
@@ -70,8 +70,8 @@ mat4 getObjectSkinnedTransform()
// If it's AMD make sure the GLSL compiler sees the arrays referenced once by static index. Otherwise it seems to optimise the storage awawy which leads to unfun crashes and artifacts.
mat3 dummy1 = matrixPalette[0];
vec3 dummy2 = translationPalette[0];
- mat3 dummy3 = matrixPalette[151];
- vec3 dummy4 = translationPalette[151];
+ mat3 dummy3 = matrixPalette[MAX_JOINTS_PER_MESH_OBJECT-1];
+ vec3 dummy4 = translationPalette[MAX_JOINTS_PER_MESH_OBJECT-1];
#endif
}