diff options
author | Dave Parks <davep@lindenlab.com> | 2013-10-10 13:56:06 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2013-10-10 13:56:06 -0500 |
commit | ff8b002c3b2bc68bdf4b88c1687a711d2d7c0ca6 (patch) | |
tree | 32397148f0966e461bdab303e41b196f1382f5c4 /indra/newview | |
parent | ea1e1b0925b386cf83178539b8eae9e25c573548 (diff) |
Quite down log spam from loading shaders.
Up bone cap to 64 for rigged meshes.
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl | 38 | ||||
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 1 | ||||
-rwxr-xr-x | indra/newview/lldrawpoolavatar.cpp | 40 | ||||
-rwxr-xr-x | indra/newview/llviewermenu.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 96 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 1 | ||||
-rwxr-xr-x | indra/newview/pipeline.h | 19 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/menu_viewer.xml | 10 |
8 files changed, 185 insertions, 24 deletions
diff --git a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl index efd0d03965..3bbcf32482 100755 --- a/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl +++ b/indra/newview/app_settings/shaders/class1/avatar/objectSkinV.glsl @@ -26,7 +26,9 @@ ATTRIBUTE vec4 weight4; -uniform mat4 matrixPalette[32]; +uniform mat3 matrixPalette[64]; +uniform vec3 translationPalette[64]; + mat4 getObjectSkinnedTransform() { @@ -34,15 +36,35 @@ mat4 getObjectSkinnedTransform() vec4 w = fract(weight4); vec4 index = floor(weight4); - + + index = min(index, vec4(63.0)); + index = max(index, vec4( 0.0)); + 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; + + int i1 = int(index.x); + int i2 = int(index.y); + int i3 = int(index.z); + int i4 = int(index.w); - return mat; + mat3 mat = matrixPalette[i1]*w.x; + mat += matrixPalette[i2]*w.y; + mat += matrixPalette[i3]*w.z; + mat += matrixPalette[i4]*w.w; + + vec3 trans = translationPalette[i1]*w.x; + trans += translationPalette[i2]*w.y; + trans += translationPalette[i3]*w.z; + trans += translationPalette[i4]*w.w; + + mat4 ret; + + ret[0] = vec4(mat[0], 0); + ret[1] = vec4(mat[1], 0); + ret[2] = vec4(mat[2], 0); + ret[3] = vec4(trans, 1.0); + + return ret; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index e5f7366b70..2b5f001873 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -534,6 +534,7 @@ void main() #ifdef FOR_IMPOSTOR vec4 color; color.rgb = diff.rgb; + color.a = 1.0; #ifdef USE_VERTEX_COLOR float final_alpha = diff.a * vertex_color.a; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index f622d5a63a..e77ed27fa2 100755 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1708,9 +1708,9 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) { if (sShaderLevel > 0) { //upload matrix palette to shader - LLMatrix4 mat[32]; + LLMatrix4 mat[64]; - U32 count = llmin((U32) skin->mJointNames.size(), (U32) 32); + U32 count = llmin((U32) skin->mJointNames.size(), (U32) 64); for (U32 i = 0; i < count; ++i) { @@ -1724,10 +1724,42 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) stop_glerror(); - LLDrawPoolAvatar::sVertexProgram->uniformMatrix4fv(LLViewerShaderMgr::AVATAR_MATRIX, + F32 mp[64*9]; + + F32 transp[64*3]; + + for (U32 i = 0; i < count; ++i) + { + F32* m = (F32*) mat[i].mMatrix; + + U32 idx = i*9; + + mp[idx+0] = m[0]; + mp[idx+1] = m[1]; + mp[idx+2] = m[2]; + + mp[idx+3] = m[4]; + mp[idx+4] = m[5]; + mp[idx+5] = m[6]; + + mp[idx+6] = m[8]; + mp[idx+7] = m[9]; + mp[idx+8] = m[10]; + + idx = i*3; + + transp[idx+0] = m[12]; + transp[idx+1] = m[13]; + transp[idx+2] = m[14]; + } + + LLDrawPoolAvatar::sVertexProgram->uniformMatrix3fv(LLViewerShaderMgr::AVATAR_MATRIX, count, FALSE, - (GLfloat*) mat[0].mMatrix); + (GLfloat*) mp); + + LLDrawPoolAvatar::sVertexProgram->uniform3fv(LLShaderMgr::AVATAR_TRANSLATION, count, transp); + stop_glerror(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ac2940fcfc..fb07ab8fbe 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1025,6 +1025,10 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_AVATAR_VOLUME; } + else if ("joints" == info_display) + { + return LLPipeline::RENDER_DEBUG_AVATAR_JOINTS; + } else if ("raycast" == info_display) { return LLPipeline::RENDER_DEBUG_RAYCAST; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fe035a0a7f..bd33ddf1a5 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1392,9 +1392,11 @@ void LLVOAvatar::getSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) //----------------------------------------------------------------------------- void LLVOAvatar::renderCollisionVolumes() { + std::ostringstream ostr; for (S32 i = 0; i < mNumCollisionVolumes; i++) { mCollisionVolumes[i].renderCollision(); + ostr << mCollisionVolumes[i].getName() << ", "; } if (mNameText.notNull()) @@ -1403,6 +1405,96 @@ void LLVOAvatar::renderCollisionVolumes() mNameText->lineSegmentIntersect(unused, unused, unused, TRUE); } + + mDebugText.clear(); + addDebugText(ostr.str()); +} + +void LLVOAvatar::renderJoints() +{ + std::ostringstream ostr; + std::ostringstream nullstr; + + for (joint_map_t::iterator iter = mJointMap.begin(); iter != mJointMap.end(); ++iter) + { + LLJoint* jointp = iter->second; + if (!jointp) + { + nullstr << iter->first << " is NULL" << std::endl; + continue; + } + + ostr << jointp->getName() << ", "; + + jointp->updateWorldMatrix(); + + gGL.pushMatrix(); + gGL.multMatrix( &jointp->getXform()->getWorldMatrix().mMatrix[0][0] ); + + gGL.diffuseColor3f( 1.f, 0.f, 1.f ); + + gGL.begin(LLRender::LINES); + + LLVector3 v[] = + { + LLVector3(1,0,0), + LLVector3(-1,0,0), + LLVector3(0,1,0), + LLVector3(0,-1,0), + + LLVector3(0,0,-1), + LLVector3(0,0,1), + }; + + //sides + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[2].mV); + + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[3].mV); + + gGL.vertex3fv(v[1].mV); + gGL.vertex3fv(v[2].mV); + + gGL.vertex3fv(v[1].mV); + gGL.vertex3fv(v[3].mV); + + + //top + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[4].mV); + + gGL.vertex3fv(v[1].mV); + gGL.vertex3fv(v[4].mV); + + gGL.vertex3fv(v[2].mV); + gGL.vertex3fv(v[4].mV); + + gGL.vertex3fv(v[3].mV); + gGL.vertex3fv(v[4].mV); + + + //bottom + gGL.vertex3fv(v[0].mV); + gGL.vertex3fv(v[5].mV); + + gGL.vertex3fv(v[1].mV); + gGL.vertex3fv(v[5].mV); + + gGL.vertex3fv(v[2].mV); + gGL.vertex3fv(v[5].mV); + + gGL.vertex3fv(v[3].mV); + gGL.vertex3fv(v[5].mV); + + gGL.end(); + + gGL.popMatrix(); + } + + mDebugText.clear(); + addDebugText(ostr.str()); + addDebugText(nullstr.str()); } BOOL LLVOAvatar::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, @@ -3077,9 +3169,6 @@ void LLVOAvatar::forceUpdateVisualMuteSettings() //------------------------------------------------------------------------ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { - // clear debug text - mDebugText.clear(); - if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) { S32 central_bake_version = -1; @@ -3588,6 +3677,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { setDebugText(mDebugText); } + mDebugText.clear(); //mesh vertices need to be reskinned mNeedsSkin = TRUE; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 931e65b3ea..5d897ee44e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -406,6 +406,7 @@ public: F32 getLastSkinTime() { return mLastSkinTime; } U32 renderTransparent(BOOL first_pass); void renderCollisionVolumes(); + void renderJoints(); static void deleteCachedImages(bool clearAll=true); static void destroyGL(); static void restoreGL(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9aeb2d4978..1c7154d413 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -535,15 +535,16 @@ public: RENDER_DEBUG_SHADOW_FRUSTA = 0x00040000, RENDER_DEBUG_SCULPTED = 0x00080000, RENDER_DEBUG_AVATAR_VOLUME = 0x00100000, - RENDER_DEBUG_BUILD_QUEUE = 0x00200000, - RENDER_DEBUG_AGENT_TARGET = 0x00400000, - RENDER_DEBUG_UPDATE_TYPE = 0x00800000, - RENDER_DEBUG_PHYSICS_SHAPES = 0x01000000, - RENDER_DEBUG_NORMALS = 0x02000000, - RENDER_DEBUG_LOD_INFO = 0x04000000, - RENDER_DEBUG_RENDER_COMPLEXITY = 0x08000000, - RENDER_DEBUG_ATTACHMENT_BYTES = 0x10000000, - RENDER_DEBUG_TEXEL_DENSITY = 0x20000000 + RENDER_DEBUG_AVATAR_JOINTS = 0x00200000, + RENDER_DEBUG_BUILD_QUEUE = 0x00400000, + RENDER_DEBUG_AGENT_TARGET = 0x00800000, + RENDER_DEBUG_UPDATE_TYPE = 0x01000000, + RENDER_DEBUG_PHYSICS_SHAPES = 0x02000000, + RENDER_DEBUG_NORMALS = 0x04000000, + RENDER_DEBUG_LOD_INFO = 0x08000000, + RENDER_DEBUG_RENDER_COMPLEXITY = 0x10000000, + RENDER_DEBUG_ATTACHMENT_BYTES = 0x20000000, + RENDER_DEBUG_TEXEL_DENSITY = 0x40000000 }; public: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index d635b8ee93..7d28d87f63 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2572,6 +2572,16 @@ parameter="collision skeleton" /> </menu_item_check> <menu_item_check + label="Joints" + name="Joints"> + <menu_item_check.on_check + function="Advanced.CheckInfoDisplay" + parameter="joints" /> + <menu_item_check.on_click + function="Advanced.ToggleInfoDisplay" + parameter="joints" /> + </menu_item_check> + <menu_item_check label="Raycast" name="Raycast"> <menu_item_check.on_check |