From 486c954a7c0e6eec62360292ba691f889473bbd8 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Thu, 1 Jan 2026 15:01:54 +0900 Subject: [PATCH 1/2] [add] Additional RobeMethod --- Jusin154_Team3D/Client/Private/MainApp.cpp | 1 - Jusin154_Team3D/Client/Private/Player.cpp | 16 ++-- Jusin154_Team3D/Client/Private/PlayerRobe.cpp | 52 +---------- Jusin154_Team3D/Client/Public/PlayerRobe.h | 5 -- .../ShaderFiles/Engine_Shader_Defines.hlsli | 1 + .../ShaderFiles/Shader_NPC_PBR_Anim.hlsl | 90 ++++++++++++++++--- .../ShaderFiles/Engine_Shader_Defines.hlsli | 1 + 7 files changed, 86 insertions(+), 80 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index 7d7dbc6ca..a792a9d92 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -87,7 +87,6 @@ HRESULT CMainApp::Render() m_pGameInstance->Draw(); GUI::Render(); - //m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("피곤해 못 써"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f)); ImGui_ImplDX11_RenderDrawData(GUI::GetDrawData()); m_pGameInstance->Render_End(); diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index c4d369257..18ca0c746 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -252,9 +252,6 @@ HRESULT CPlayer::Render() for (_uint i = 0; i < iNumMeshes; i++) { - if (PLAYER_MESH_ORDER::LOWER == (PLAYER_MESH_ORDER)i) { - continue; - } if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } @@ -600,10 +597,7 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder) break; #ifdef _DEBUG case PLAYER_MESH_ORDER::ROBE_CLOTH: - {//if (FAILED(m_pModelCom->Bind_BoneMatrices(ENUM_CLASS(PLAYER_MESH_ORDER::ROBE_CLOTH), m_pShaderCom, "g_BoneMatrices"))) { - // return E_FAIL; - //} - + { CMesh* pMesh = m_pModelCom->Get_Mesh(ENUM_CLASS(PLAYER_MESH_ORDER::ROBE_CLOTH)); _uint paletteCount = pMesh->Get_NumBone(); @@ -619,8 +613,8 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder) for (_uint i = 0; i < paletteCount; ++i) { _uint global = boneIndices[i]; - //if (global == 38) - // continue; + if (global == 38) + continue; if (globalMask[global] == 1) { SkinMatrices[i] = m_pRobePart->Get_RobeJointAnchorMatrix(temp++); @@ -632,8 +626,8 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder) for (_uint i = 0; i < paletteCount; ++i) { - //if (i == 29) - // continue; + if (i == 29) + continue; _uint global = boneIndices[i]; paletteMask[i] = globalMask[global]; } diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp index 7dc35626e..8c8849385 100644 --- a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp @@ -72,15 +72,6 @@ HRESULT CPlayerRobe::Update_RobeSocketPosition() m_pModelCom->Set_BoneCombinedTransformation(PLAYER_JOINT_BONE_NAMES[i], LocalMatrix); } } - //{ - // D3D11_MAPPED_SUBRESOURCE SubResource{}; - // if (FAILED(m_pContext->Map(m_pBoneCombinedMatrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) { - // return E_FAIL; - // } - // memcpy_s(SubResource.pData, sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END), m_ReconstructedJointAnchorMatirces, sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)); - // m_pContext->Unmap(m_pBoneCombinedMatrixBuffer, 0); - //} - //m_pModelCom->ComputeInsertionBoneBuffer(m_BoneInsertionDesc, m_pBoneCombinedMatrixSRV); return S_OK; } @@ -115,35 +106,6 @@ HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DY return S_OK; } -HRESULT CPlayerRobe::Create_BoneCombinedMatrixSRV() -{ - D3D11_BUFFER_DESC desc{}; - desc.Usage = D3D11_USAGE_DYNAMIC; - desc.ByteWidth = sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); - desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; - desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - desc.StructureByteStride = sizeof(_float4x4); - desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; - - if (FAILED(m_pDevice->CreateBuffer(&desc, nullptr, &m_pBoneCombinedMatrixBuffer))) { - return E_FAIL; - } - - D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; - srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; - srvDesc.Format = DXGI_FORMAT_UNKNOWN; - srvDesc.Buffer.FirstElement = 0; - srvDesc.Buffer.NumElements = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); - - - if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneCombinedMatrixBuffer, &srvDesc, &m_pBoneCombinedMatrixSRV))){ - return E_FAIL; - } - - return S_OK; -} - - HRESULT CPlayerRobe::Update_LegsPosition() { _matrix WorldMatrix = m_pParentTransformCom->Get_XMWorldMatrix(); @@ -526,13 +488,6 @@ HRESULT CPlayerRobe::Initialize(void* pArg) m_pRightFootLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("RightFoot"); m_pRightLegLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("RightLeg"); - { - ZeroMemory(&m_BoneInsertionDesc, sizeof(m_BoneInsertionDesc)); - m_BoneInsertionDesc.iMatrixCount = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); - m_BoneInsertionDesc.iStartOffset = m_pModelCom->Get_BoneIndex(PLAYER_JOINT_BONE_NAMES[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTUP)]); - } - Create_BoneCombinedMatrixSRV(); - XMStoreFloat4x4(&m_PreTransformMatrix, XMLoadFloat4x4(m_pModelCom->Get_PreTransformMatrixPtr())); for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) { @@ -647,8 +602,6 @@ void CPlayerRobe::Free() #ifdef _DEBUG SAFE_RELEASE(m_pDepthStencilStateNone); #endif // _DEBUG - SAFE_RELEASE(m_pBoneCombinedMatrixSRV); - SAFE_RELEASE(m_pBoneCombinedMatrixBuffer); SAFE_RELEASE(m_pRightLeg); SAFE_RELEASE(m_pLeftLeg); SAFE_RELEASE(m_pRobeMainAnchor); @@ -666,12 +619,13 @@ void CPlayerRobe::Describe_Entity() GUI::Begin("PhysX"); if (GUI::CollapsingHeader("Robe")) { for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { - if (GUI::BeginChild("##i")) { + if (GUI::BeginChild(("Child ID: " + to_string((size_t)(this))).c_str())) { - GUI::EndChild(); } + GUI::EndChild(); } } + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Public/PlayerRobe.h b/Jusin154_Team3D/Client/Public/PlayerRobe.h index e981395e7..b403a5869 100644 --- a/Jusin154_Team3D/Client/Public/PlayerRobe.h +++ b/Jusin154_Team3D/Client/Public/PlayerRobe.h @@ -56,10 +56,6 @@ class CPlayerRobe final : public CPartObject CRigidBody_Dynamic* m_pRobeJointAnchor[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { nullptr }; PSX::PxD6Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr }; - ID3D11Buffer* m_pBoneCombinedMatrixBuffer = { nullptr }; - ID3D11ShaderResourceView* m_pBoneCombinedMatrixSRV = { nullptr }; - - CModel::BONEINSERTION_DESC m_BoneInsertionDesc = {}; vector<_float4x4> m_PrevRobeBoneMatrices = { }; #ifdef _DEBUG unique_ptr m_pMainShape = { nullptr }; @@ -76,7 +72,6 @@ class CPlayerRobe final : public CPartObject HRESULT Update_LegsPosition(); HRESULT Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld); - HRESULT Create_BoneCombinedMatrixSRV(); #ifdef _DEBUG HRESULT Render_BonePhysX(); HRESULT Render_Legs(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index e8874e5d2..3ef93fd23 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -1,6 +1,7 @@ #ifndef ENGINE_SHADER_DEFINES_HLSLI #define ENGINE_SHADER_DEFINES_HLSLI +#pragma pack_matrix(row_major) #include "Engine_Shader_Constants.hlsli" #include "Engine_Shader_Structures.hlsli" #include "Engine_Shader_Samplers.hlsli" diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl index 6207e7885..a94e1c3c6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl @@ -266,7 +266,7 @@ VS_OUT VS_MAIN_LEGACY(VS_IN In) VS_OUT Out = (VS_OUT) 0; float4 w = In.vBlendWeight; - float sumW = max(dot(w, 1.0f), 1e-6f); + float sumW = max(dot(w, 1.0f), FLT_EPSILON5); w /= sumW; uint4 idx = In.vBlendIndex; @@ -278,26 +278,88 @@ VS_OUT VS_MAIN_LEGACY(VS_IN In) + g_RobeBoneMask[idx.w] * w.w; bool isRobe = robeWeight > g_TempWeight; - matrix BoneMatrix = (matrix) 0; - - if (isRobe) { - BoneMatrix += w.x * mul(g_OffsetMatrix[idx.x], g_BoneMatrices[idx.x]); - BoneMatrix += w.y * mul(g_OffsetMatrix[idx.y], g_BoneMatrices[idx.y]); - BoneMatrix += w.z * mul(g_OffsetMatrix[idx.z], g_BoneMatrices[idx.z]); - BoneMatrix += w.w * mul(g_OffsetMatrix[idx.w], g_BoneMatrices[idx.w]); + uint iIndex = idx.x; + float fWeight = w.x; + if (isRobe) + { + if (29 == iIndex) + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + } + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + } } - else { - BoneMatrix += w.x * mul(g_OffsetMatrix[idx.x], g_BoneBuffer[idx.x].LocalCombined); - BoneMatrix += w.y * mul(g_OffsetMatrix[idx.y], g_BoneBuffer[idx.y].LocalCombined); - BoneMatrix += w.z * mul(g_OffsetMatrix[idx.z], g_BoneBuffer[idx.z].LocalCombined); - BoneMatrix += w.w * mul(g_OffsetMatrix[idx.w], g_BoneBuffer[idx.w].LocalCombined); + uint iIndex = idx.y; + float fWeight = w.y; + if (isRobe) + { + if (29 == iIndex) + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + } + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + } } + { + uint iIndex = idx.z; + float fWeight = w.z; + if (isRobe) + { + if (29 == iIndex) + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + } + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + } + } + { + uint iIndex = idx.w; + float fWeight = w.w; + if (isRobe) + { + if (29 == iIndex) + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); - matrix PrevBoneMatrix = + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + } + } + else + { + BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + } + } + matrix PrevBoneMatrix = mul(g_OffsetMatrix[In.vBlendIndex.x], mul(g_PrevBoneMatrices[In.vBlendIndex.x], w.x)) + mul(g_OffsetMatrix[In.vBlendIndex.y], diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index e8874e5d2..3ef93fd23 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -1,6 +1,7 @@ #ifndef ENGINE_SHADER_DEFINES_HLSLI #define ENGINE_SHADER_DEFINES_HLSLI +#pragma pack_matrix(row_major) #include "Engine_Shader_Constants.hlsli" #include "Engine_Shader_Structures.hlsli" #include "Engine_Shader_Samplers.hlsli" From c63eb6992dd9a1b91db1bdc0034b9c6727643a68 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Thu, 1 Jan 2026 15:10:25 +0900 Subject: [PATCH 2/2] [fix] Merge --- .../ShaderFiles/Shader_NPC_PBR_Anim.hlsl | 274 +++++++++--------- 1 file changed, 144 insertions(+), 130 deletions(-) diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl index 35ef22c86..067eb1772 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl @@ -37,35 +37,35 @@ float g_TempWeight; -Texture2D g_DiffuseTexture : register(t00); -Texture2D g_SpecularTexture : register(t01); -Texture2D g_AmbientTexture : register(t02); -Texture2D g_EmissiveTexture : register(t03); -Texture2D g_HeightTexture : register(t04); -Texture2D g_NormalTexture : register(t05); -Texture2D g_ShininessTexture : register(t06); -Texture2D g_NormalBlendTexture : register(t07); // OPACITY -Texture2D g_SROBlendTexture : register(t08); -Texture2D g_LightMapTexture : register(t09); -Texture2D g_ReflectionTexture : register(t10); -Texture2D g_DiffuseBlend : register(t11); // BASE_COLOR -Texture2D g_NormalCameraTexture : register(t12); -Texture2D g_EmissionColorTexture : register(t13); -Texture2D g_MetalnessTexture : register(t14); -Texture2D g_Diffuse_RoughnessTexture : register(t15); -Texture2D g_AmbientOcclusionTexture : register(t16); -Texture2D g_UnknownTexture : register(t17); -Texture2D g_SheenTexture : register(t18); -Texture2D g_ClearcoatTexture : register(t19); -Texture2D g_TransmissionTexture : register(t20); -Texture2D g_Maya_BaseTexture : register(t21); -Texture2D g_Maya_SpecularTexture : register(t22); -Texture2D g_Maya_Specular_ColorTexture : register(t23); -Texture2D g_Maya_Specular_RoughnessTexture : register(t24); -Texture2D g_AnisotropyTexture : register(t25); +Texture2D g_DiffuseTexture : register(t00); +Texture2D g_SpecularTexture : register(t01); +Texture2D g_AmbientTexture : register(t02); +Texture2D g_EmissiveTexture : register(t03); +Texture2D g_HeightTexture : register(t04); +Texture2D g_NormalTexture : register(t05); +Texture2D g_ShininessTexture : register(t06); +Texture2D g_NormalBlendTexture : register(t07); // OPACITY +Texture2D g_SROBlendTexture : register(t08); +Texture2D g_LightMapTexture : register(t09); +Texture2D g_ReflectionTexture : register(t10); +Texture2D g_DiffuseBlend : register(t11); // BASE_COLOR +Texture2D g_NormalCameraTexture : register(t12); +Texture2D g_EmissionColorTexture : register(t13); +Texture2D g_MetalnessTexture : register(t14); +Texture2D g_Diffuse_RoughnessTexture : register(t15); +Texture2D g_AmbientOcclusionTexture : register(t16); +Texture2D g_UnknownTexture : register(t17); +Texture2D g_SheenTexture : register(t18); +Texture2D g_ClearcoatTexture : register(t19); +Texture2D g_TransmissionTexture : register(t20); +Texture2D g_Maya_BaseTexture : register(t21); +Texture2D g_Maya_SpecularTexture : register(t22); +Texture2D g_Maya_Specular_ColorTexture : register(t23); +Texture2D g_Maya_Specular_RoughnessTexture : register(t24); +Texture2D g_AnisotropyTexture : register(t25); -StructuredBuffer g_BoneBuffer : register(t26); -StructuredBuffer g_PrevBoneBuffer : register(t27); +StructuredBuffer g_BoneBuffer : register(t26); +StructuredBuffer g_PrevBoneBuffer : register(t27); @@ -112,7 +112,7 @@ struct VS_OUT }; VS_OUT VS_MAIN_MESH(VS_IN_MESH In) { - VS_OUT Out = (VS_OUT)0; + VS_OUT Out = (VS_OUT) 0; matrix matWV, matWVP; matWV = mul(g_WorldMatrix, g_ViewMatrix); @@ -135,7 +135,7 @@ VS_OUT VS_MAIN_MESH(VS_IN_MESH In) VS_OUT VS_MAIN(VS_IN In) { - VS_OUT Out = (VS_OUT)0; + VS_OUT Out = (VS_OUT) 0; float4 w = In.vBlendWeight; float sumW = max(dot(w, 1.0f), 1e-6f); @@ -246,78 +246,91 @@ VS_OUT VS_MAIN_LEGACY(VS_IN In) { TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.w], mul(g_BoneBuffer[In.vBlendIndex.w].LocalCombined, w.w)); - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.x], - mul(g_BoneMatrices[In.vBlendIndex.x], w.x)); } - else - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.x], - mul(g_BoneBuffer[In.vBlendIndex.x].LocalCombined, w.x)); - } - if (idx.y >= MinIdx && idx.y <= MaxIdx) - //if (g_RobeBoneMask[idx.y] == 1) - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.y], - mul(g_BoneMatrices[In.vBlendIndex.y], w.y)); - } - else - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.y], - mul(g_BoneBuffer[In.vBlendIndex.y].LocalCombined, w.y)); - } - if (idx.z >= MinIdx && idx.z <= MaxIdx) - //if (g_RobeBoneMask[idx.z] == 1) - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.z], - mul(g_BoneMatrices[In.vBlendIndex.z], w.z)); - } - else - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.z], - mul(g_BoneBuffer[In.vBlendIndex.z].LocalCombined, w.z)); - } - if (idx.w >= MinIdx && idx.w <= MaxIdx) - //if (g_RobeBoneMask[idx.w] == 1) - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.w], - mul(g_BoneMatrices[In.vBlendIndex.w], w.w)); - } - else - { - TempBoneMatrix += mul(g_OffsetMatrix[In.vBlendIndex.w], - mul(g_BoneBuffer[In.vBlendIndex.w].LocalCombined, w.w)); - { - uint iIndex = idx.z; - float fWeight = w.z; - if (isRobe) - { - if (29 == iIndex) - { - BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); - - } - else - { - BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); - } - } - else - { - BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); - } - } - { - uint iIndex = idx.w; - float fWeight = w.w; - if (isRobe) - { - if (29 == iIndex) - { - BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); BoneMatrix = TempBoneMatrix; - + //matrix BoneMatrix = (matrix) 0; + //{ + // uint iIndex = idx.x; + // float fWeight = w.x; + // if (isRobe) + // { + // if (29 == iIndex) + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + // } + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + // } + //} + //{ + // uint iIndex = idx.y; + // float fWeight = w.y; + // if (isRobe) + // { + // if (29 == iIndex) + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + // } + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + // } + //} + //{ + // uint iIndex = idx.z; + // float fWeight = w.z; + // if (isRobe) + // { + // if (29 == iIndex) + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + // } + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + // } + //} + //{ + // uint iIndex = idx.w; + // float fWeight = w.w; + // if (isRobe) + // { + // if (29 == iIndex) + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneMatrices[iIndex])); + // } + // } + // else + // { + // BoneMatrix += mul(fWeight, mul(g_OffsetMatrix[iIndex], g_BoneBuffer[iIndex].LocalCombined)); + // } + //} //float robeWeight = // g_RobeBoneMask[idx.x] * w.x @@ -345,7 +358,7 @@ VS_OUT VS_MAIN_LEGACY(VS_IN In) //} - matrix PrevBoneMatrix = + matrix PrevBoneMatrix = mul(g_OffsetMatrix[In.vBlendIndex.x], mul(g_PrevBoneMatrices[In.vBlendIndex.x], w.x)) + mul(g_OffsetMatrix[In.vBlendIndex.y], @@ -383,7 +396,7 @@ VS_OUT VS_MAIN_LEGACY(VS_IN In) VS_OUT VS_MAIN_OUTLINE_READ(VS_IN In) { - VS_OUT Out = (VS_OUT)0; + VS_OUT Out = (VS_OUT) 0; float4 w = In.vBlendWeight; float sumW = max(dot(w, 1.0f), 1e-6f); @@ -543,7 +556,7 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE_READ(PS_IN In) PS_OUT PS_EYELASH_DAOTHV_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -586,7 +599,7 @@ PS_OUT PS_EYELASH_DAOTHV_ToSRO(PS_IN In) PS_OUT PS_TEETH_SRXO_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -619,7 +632,7 @@ PS_OUT PS_TEETH_SRXO_ToSRO(PS_IN In) PS_OUT PS_EYE_DN_SRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -649,7 +662,7 @@ PS_OUT PS_EYE_DN_SRO(PS_IN In) PS_OUT PS_EYE_OCC(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; discard; return Out; } @@ -657,7 +670,7 @@ PS_OUT PS_EYE_OCC(PS_IN In) PS_OUT PS_FACIAL_HAIR_DAOTHV_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -701,7 +714,7 @@ PS_OUT PS_FACIAL_HAIR_DAOTHV_ToSRO(PS_IN In) PS_OUT PS_HEAD_HAIR_DAOTHV_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -744,7 +757,7 @@ PS_OUT PS_HEAD_HAIR_DAOTHV_ToSRO(PS_IN In) PS_OUT PS_HEADwtHAND_DSRXON_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -776,7 +789,7 @@ PS_OUT PS_HEADwtHAND_DSRXON_ToSRO(PS_IN In) PS_OUT PS_LOWER_DSRON_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -808,7 +821,7 @@ PS_OUT PS_LOWER_DSRON_ToSRO(PS_IN In) PS_OUT PS_UPPER_DMRON_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -840,7 +853,7 @@ PS_OUT PS_UPPER_DMRON_ToMRO(PS_IN In) PS_OUT PS_GLASSES_DMRON_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -872,7 +885,7 @@ PS_OUT PS_GLASSES_DMRON_ToMRO(PS_IN In) PS_OUT PS_EmissiveMetalness_DENMRO_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); @@ -906,7 +919,7 @@ PS_OUT PS_EmissiveMetalness_DENMRO_ToMRO(PS_IN In) PS_OUT PS_DNMRO_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); @@ -940,7 +953,7 @@ PS_OUT PS_DNMRO_ToMRO(PS_IN In) PS_OUT PS_MI_ClothSim_DSEN_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -974,7 +987,7 @@ PS_OUT PS_MI_ClothSim_DSEN_ToSRO(PS_IN In) PS_OUT PS_MI_DANSROMRO_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -1013,7 +1026,7 @@ PS_OUT PS_MI_DANSROMRO_ToSRO(PS_IN In) PS_OUT PS_Troll_Club_DAENMROSRXO_ToMROX(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); if (true == g_bDisolve) @@ -1053,7 +1066,7 @@ PS_OUT PS_Troll_Club_DAENMROSRXO_ToMROX(PS_IN In) } PS_OUT PS_Player_EyeLash_DAOTHV_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float2 center = float2(0.5f, 0.5f); float2 p = uv - center; @@ -1098,7 +1111,7 @@ PS_OUT PS_Player_EyeLash_DAOTHV_ToSRO(PS_IN In) } PS_OUT PS_Player_Eye_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve) @@ -1128,7 +1141,7 @@ PS_OUT PS_Player_Eye_ToMRO(PS_IN In) } PS_OUT PS_Player_Robe_ToMRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve) @@ -1160,7 +1173,7 @@ PS_OUT PS_Player_Robe_ToMRO(PS_IN In) } PS_OUT PS_Player_Suit_DSRON_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve) @@ -1190,7 +1203,7 @@ PS_OUT PS_Player_Suit_DSRON_ToSRO(PS_IN In) } PS_OUT PS_Player_HairDAOTHV_ToSRO(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDAOColor = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve) @@ -1200,17 +1213,17 @@ PS_OUT PS_Player_HairDAOTHV_ToSRO(PS_IN In) } float3 vHairBaseColor = g_NormalBlendTexture.Sample(DefaultSampler, uv).rrr; float4 vNormalColor = g_NormalTexture.Sample(DefaultSampler, uv); - float4 vTHVColor = g_DiffuseBlend.Sample(DefaultSampler, uv); + float4 vTHVColor = g_DiffuseBlend.Sample(DefaultSampler, uv); float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); - float AlphaMask = vDAOColor.g; - float AoMask_Dao = vDAOColor.b; - float RootTip = vTHVColor.r; - float SpecMask = vTHVColor.g; - float AoMask_Thv = vTHVColor.b; // Volume + float AlphaMask = vDAOColor.g; + float AoMask_Dao = vDAOColor.b; + float RootTip = vTHVColor.r; + float SpecMask = vTHVColor.g; + float AoMask_Thv = vTHVColor.b; // Volume float3 vColorHair = clamp(ColorMixer(vHairBaseColor, UnpackRGB8(g_iPackedBlendColor), g_fMixerFactor, g_iColorMixerMethod), 0.f, 1.f); float3 vColorRoot = vColorHair * 0.6f; @@ -1266,19 +1279,20 @@ PS_OUT_BLEND PS_Dragon_EtherealWings(PS_IN In) { PS_OUT_BLEND Out; float2 uv = In.vTexcoord; - float2 uvDiffuse = uv; uvDiffuse.y -= g_fEtherealRatio; + float2 uvDiffuse = uv; + uvDiffuse.y -= g_fEtherealRatio; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uvDiffuse); float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, uv); vDiffuse += vEmissive; float fOppacity = g_NormalBlendTexture.Sample(DefaultSampler, uvDiffuse).a; - vDiffuse.a = (1- fOppacity); + vDiffuse.a = (1 - fOppacity); Out.vAlbedo = vDiffuse; return Out; } PS_OUT PS_Dragon_Body(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve) @@ -1314,7 +1328,7 @@ PS_OUT PS_Dragon_Body(PS_IN In) PS_OUT PS_Dragon_Wings(PS_IN In) { - PS_OUT Out = (PS_OUT)0; + PS_OUT Out = (PS_OUT) 0; float2 uv = In.vTexcoord; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uv); if (true == g_bDisolve)