follow
@@ -30,10 +30,17 @@ float2 g_fCurrent_Size;
|
||||
float2 g_fHpBG;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
float4 g_fImageUV;
|
||||
float4 g_fImageUV1;
|
||||
|
||||
float2 g_fPosition[4];
|
||||
float4 g_fImagesUV[4];
|
||||
|
||||
Texture2D g_Texture;
|
||||
Texture2D g_Texture1;
|
||||
Texture2D g_Texture2;
|
||||
Texture2D g_Texture3;
|
||||
Texture2D g_Texture4;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
|
||||
@@ -97,6 +104,8 @@ PS_OUT PS_AlphaBlend(PS_IN In)
|
||||
|
||||
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Color.rgb *= 1.5f;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
@@ -525,7 +534,6 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv);
|
||||
Color = tex1;
|
||||
|
||||
float2 reversuv = In.vTexcoord;
|
||||
|
||||
reversuv.x = 1.0f - Finaluv;
|
||||
@@ -537,7 +545,9 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
tex2.rgb *= float3(112.f, 241.f, 31.f) / 255.f;
|
||||
float3 Green = float3(112.f, 241.f, 31.f) / 255.f;
|
||||
Green *= 1.2f;
|
||||
tex2.rgb *= Green;
|
||||
|
||||
if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f)))
|
||||
Color = tex2;
|
||||
@@ -547,6 +557,125 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Magic_Meter(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
float3 Blue = float3(41.f, 165.f, 255.f) / 255.f;
|
||||
|
||||
float4 color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord);
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
float2 reverseuv = 1.f - In.vTexcoord;
|
||||
|
||||
color = tex1;
|
||||
tex2.rgb *= Blue * 1.5f;
|
||||
|
||||
if (reverseuv.x >= g_fHp)
|
||||
{
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f)))
|
||||
color = tex2;
|
||||
|
||||
color.a *= Alpha;
|
||||
|
||||
Out.vColor = color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
PS_OUT PS_Magic_Icon(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
float2 center = float2(0.5, 0.5);
|
||||
float scale = 1.2;
|
||||
|
||||
uv = (uv - center) * scale + center;
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, uv);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color = tex1 * (1 - tex2.a) + tex2;
|
||||
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_RemapUV(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
float2 startUV = g_fImageUV.xy;
|
||||
float2 endUV = g_fImageUV.zw;
|
||||
|
||||
float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Revelio(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float2 UV = In.vTexcoord;
|
||||
|
||||
float2 Position[4];
|
||||
float2 startUV[4];
|
||||
float2 endUV[4];
|
||||
|
||||
float2 Atlases[4];
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
Position[i] = g_fPosition[i];
|
||||
startUV[i] = g_fImagesUV[i].xy;
|
||||
endUV[i] = g_fImagesUV[i].zw;
|
||||
|
||||
Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]);
|
||||
}
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, UV);
|
||||
float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]);
|
||||
float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]);
|
||||
float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]);
|
||||
float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]);
|
||||
|
||||
|
||||
|
||||
//float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 PosTexTechnique11
|
||||
{
|
||||
pass Default
|
||||
@@ -687,4 +816,44 @@ technique11 PosTexTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_HpBar();
|
||||
}
|
||||
pass Magic_Meter
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Meter();
|
||||
}
|
||||
|
||||
pass Magic_Icon
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Icon();
|
||||
}
|
||||
|
||||
pass RemapUV
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_RemapUV();
|
||||
}
|
||||
|
||||
pass Revelio
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Revelio();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>Engine.lib;fmod_vc.lib;DirectXTKd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
@@ -175,6 +175,8 @@
|
||||
<ClInclude Include="..\Public\Client_Define.h" />
|
||||
<ClInclude Include="..\Public\Client_Enum.h" />
|
||||
<ClInclude Include="..\Public\Client_Macro.h" />
|
||||
<ClInclude Include="..\Public\Goblin.h" />
|
||||
<ClInclude Include="..\Public\Monster.h" />
|
||||
<ClInclude Include="..\Public\PhysXEffectHitBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXWall.h" />
|
||||
@@ -223,6 +225,9 @@
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp" />
|
||||
<ClCompile Include="..\Private\Monster.cpp" />
|
||||
<ClCompile Include="..\Private\PhysXEffectHitBox.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Socket.cpp" />
|
||||
|
||||
@@ -157,6 +157,12 @@
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Monster.h">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -245,9 +251,6 @@
|
||||
<Filter Include="02.GameObjects\Environment\Plane">
|
||||
<UniqueIdentifier>{603938cc-e4fe-44d8-890b-784174a86161}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Player">
|
||||
<UniqueIdentifier>{11250d84-e19c-4999-a5d6-d9f89123e7ae}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
|
||||
<UniqueIdentifier>{b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -305,15 +308,6 @@
|
||||
<Filter Include="02.GameObjects\SkyBox">
|
||||
<UniqueIdentifier>{e83f88ec-c414-43b4-b437-52288cee431a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item">
|
||||
<UniqueIdentifier>{9cc88058-bda3-4ed0-9ec9-1968963fdda4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Broom">
|
||||
<UniqueIdentifier>{aac01a47-304a-4319-8bd8-fdd9020ddf18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Wand">
|
||||
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\PhysX">
|
||||
<UniqueIdentifier>{ddf8c8e6-ca51-42e0-b08f-13ae0fd9d842}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -389,6 +383,24 @@
|
||||
<Filter Include="02.GameObjects\Cameras\Camera_Gaze">
|
||||
<UniqueIdentifier>{470c4db5-b306-4fb8-8338-0a99ac77ac89}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\Effects\Decendo">
|
||||
<UniqueIdentifier>{3572e19c-c7cc-4c7a-add0-2012b81b3935}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item">
|
||||
<UniqueIdentifier>{9cc88058-bda3-4ed0-9ec9-1968963fdda4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Broom">
|
||||
<UniqueIdentifier>{aac01a47-304a-4319-8bd8-fdd9020ddf18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Wand">
|
||||
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster">
|
||||
<UniqueIdentifier>{d371e373-e343-4e0b-9a0c-34eae167c1cd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||
<UniqueIdentifier>{1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -535,6 +547,15 @@
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Monster.cpp">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -179,11 +179,13 @@ void CBombard::Free()
|
||||
SAFE_RELEASE(m_pLight_Projectile);
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CBombard::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CBombard::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
@@ -157,7 +157,10 @@ void CBroom::Free()
|
||||
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CBroom::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -43,7 +43,10 @@ CGameObject* CCamPosition::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamPosition::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -99,6 +99,10 @@ void CCamPosition_Arm::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamPosition_Arm::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -66,6 +66,7 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta)
|
||||
if (true == m_bMovable) {
|
||||
m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor;
|
||||
m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor;
|
||||
CMyTools::AdjustAccumulateDegreePitchYawDegree(m_vAccDegreeXY);
|
||||
}
|
||||
|
||||
_vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio));
|
||||
@@ -93,7 +94,10 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta)
|
||||
if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) {
|
||||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_GRAVE)) {
|
||||
m_bMovable = !m_bMovable;
|
||||
}
|
||||
@@ -212,14 +216,19 @@ void CCamPosition_Shoulder::Free()
|
||||
SAFE_RELEASE(m_pTarget_LookPart);
|
||||
SAFE_RELEASE(m_pTarget_FollowPart);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamPosition_Shoulder::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Cam_Shoulder");
|
||||
m_pTransformCom->Describe_Entity();
|
||||
GUI::Text("fMouseSensor : %.1f", &m_fMouseSensor);
|
||||
|
||||
GUI::Text("fMouseSensor : %.1f", m_fMouseSensor);
|
||||
GUI::SliderFloat("ShoulderDistance", &m_fShoulderDistance, 0.f, 10.f, "%.1f");
|
||||
GUI::SliderFloat("BackFrontRatio", &m_fBackFrontRatio, 0.01f, 0.99f, "%.2f");
|
||||
GUI::Text("Pitch Yaw : %f %f", &m_vAccDegreeXY.x, &m_vAccDegreeXY.y);
|
||||
GUI::Text("Pitch Yaw : %f %f", m_vAccDegreeXY.x, m_vAccDegreeXY.y);
|
||||
GUI::SliderFloat3("ShoulderPosRatio", (_float*)&m_vShoulderPosRatio, -2.f, 2.f, "%.1f");
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -99,7 +99,10 @@ void CCamPosition_Socket::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamPosition_Socket::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -89,6 +89,10 @@ void CCamPosition_Target::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamPosition_Target::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -155,7 +155,10 @@ void CCamera_Debug::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamera_Debug::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -41,14 +41,16 @@ void CCamera_Gaze::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CCamera_Gaze::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Text("%d", m_iPriority);
|
||||
GUI::Text("CAM_GAZE_PRIORITY : %d", m_iPriority);
|
||||
if (false == m_bActive) {
|
||||
return;
|
||||
}
|
||||
Transition(fTimeDelta);
|
||||
Update_LerpTimer(fTimeDelta);
|
||||
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
}
|
||||
|
||||
void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
@@ -60,7 +62,6 @@ void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
m_vLookLerpTime.x += fTimeDelta;
|
||||
if (m_vLookLerpTime.y <= m_vLookLerpTime.x) {
|
||||
m_vLookLerpTime.x = 0.f;
|
||||
m_bEnable_LookLerp = false;
|
||||
XMStoreFloat3(&m_vLookPos_Src, XMLoadFloat3(&m_vLookPos_Dest));
|
||||
XMStoreFloat3(&m_vLookPos_Dest, m_pLookTarget->Get_WorldPostion());
|
||||
}
|
||||
@@ -70,7 +71,6 @@ void CCamera_Gaze::Update_LerpTimer(Engine::_float fTimeDelta)
|
||||
m_vFollowLerpTime.x += fTimeDelta;
|
||||
if (m_vFollowLerpTime.y <= m_vFollowLerpTime.x) {
|
||||
m_vFollowLerpTime.x = 0.f;
|
||||
m_bEnable_FollowLerp = false;
|
||||
XMStoreFloat3(&m_vFollowPos_Src, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
XMStoreFloat3(&m_vFollowPos_Dest, m_pFollowTarget->Get_WorldPostion());
|
||||
}
|
||||
@@ -168,6 +168,9 @@ void CCamera_Gaze::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CCamera_Gaze::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("Camera_Gaze_Describe");
|
||||
@@ -196,3 +199,5 @@ void CCamera_Gaze::Describe_Entity()
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -48,13 +48,15 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta)
|
||||
m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor());
|
||||
}
|
||||
}
|
||||
m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f));
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
}
|
||||
|
||||
void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
@@ -219,8 +221,11 @@ void CDummy_PhysXPlayable::Free()
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CDummy_PhysXPlayable::Describe_Entity()
|
||||
{
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -161,7 +161,10 @@ void CDummy_PhysXWall::Free()
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CDummy_PhysXWall::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -86,8 +86,6 @@ HRESULT CEffectParts::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -123,8 +121,11 @@ void CEffectParts::Free()
|
||||
__super::Free();
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CEffectParts::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -0,0 +1,229 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CMonster(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CGoblin::CGoblin(const CGoblin& Prototype)
|
||||
: CMonster(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
Add_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(-10.f, 0.f, -10.f, 1.f));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
}
|
||||
|
||||
void CGoblin::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
|
||||
}
|
||||
|
||||
void CGoblin::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Ready_Components()
|
||||
{
|
||||
CTransform::TRANSFORM_DESC Desc = {};
|
||||
|
||||
Desc.fSpeedPerSec = 10.f;
|
||||
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
|
||||
Desc.fRadius = 10.f;
|
||||
|
||||
__super::Ready_Components(&Desc);
|
||||
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Model");
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER);
|
||||
Desc.pTransform = m_pTransformCom;
|
||||
Desc.eBodyType = ACTOR::CAPSULE;
|
||||
Desc.fContactOffset = 0.1f;
|
||||
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
|
||||
Desc.bAutoStepping = { false };
|
||||
Desc.fStepOffset = { 0.05f };
|
||||
Desc.fRadius = 0.5f;
|
||||
Desc.fHeight = 1.0f;
|
||||
Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create();
|
||||
Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create();
|
||||
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION));
|
||||
{ // DO
|
||||
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
|
||||
Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER);
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CGoblin* CGoblin::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CGoblin* pInstance = new CGoblin(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CGoblin");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CGoblin::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CGoblin* pInstance = new CGoblin(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CGoblin");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CGoblin::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
if (nullptr != m_pCallBack_Behavior) {
|
||||
m_pCallBack_Behavior->Finalize();
|
||||
}
|
||||
if (nullptr != m_pCallBack_HitReport) {
|
||||
m_pCallBack_HitReport->Finalize();
|
||||
}
|
||||
|
||||
SAFE_RELEASE(m_pCharacter_Controller);
|
||||
SAFE_RELEASE(m_pRigidBody);
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
}
|
||||
|
||||
void CGoblin::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#pragma endregion
|
||||
|
||||
|
||||
void CGoblin::Behavior_IdleEnter()
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE);
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_IdleExitCheck()
|
||||
{
|
||||
if (m_fTargetDistance <= 15.f)
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::MOVE);
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (m_fTargetDistance <= 3.f)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_CombatEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = {};
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::COMBAT);
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::SKILL);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SKILL];
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CGoblin::Behavior_CombatExitCheck()
|
||||
{
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CGoblin::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2);
|
||||
}
|
||||
|
||||
|
||||
void CGoblin::Add_FSM()
|
||||
{
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
{
|
||||
CState_Combat::STATE_COMBAT_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_CombatExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CGoblin::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 22,true };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 50,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 58,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 46,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙
|
||||
m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기
|
||||
}
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Broom.h"
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -37,6 +38,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Layer_Monster())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -49,7 +53,7 @@ HRESULT CLevel_GamePlay::Initialize()
|
||||
|
||||
void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_F1))
|
||||
if (m_pGameInstance->Key_Up(DIK_ADD))
|
||||
{
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
@@ -130,7 +134,7 @@ HRESULT CLevel_GamePlay::Ready_Markers()
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag,nullptr,nullptr,&m_pPlayerTemp)))
|
||||
return E_FAIL;
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
@@ -157,6 +161,14 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, m_pPlayerTemp)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
pair<CLevel*, function<void()>> CLevel_GamePlay::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg)
|
||||
{
|
||||
CLevel_GamePlay* pInstance = new CLevel_GamePlay(pDevice, pContext, eLevelID);
|
||||
|
||||
@@ -110,7 +110,10 @@ void CLight_Main::Free()
|
||||
|
||||
Safe_Release(m_pLightCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CLight_Main::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "Wand.h"
|
||||
#include "SkyBox.h"
|
||||
#include "Broom.h"
|
||||
#include "Goblin.h"
|
||||
|
||||
#pragma region PHYSX
|
||||
|
||||
@@ -32,6 +33,7 @@
|
||||
#include "Bombard.h"
|
||||
#include "TrailObject.h"
|
||||
#include "Instance_Model.h"
|
||||
#include "Trail.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -217,6 +219,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_POSTEX,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPosTex.hlsl"),
|
||||
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
@@ -268,17 +276,21 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_SkyboxModel */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity()))))
|
||||
@@ -287,6 +299,9 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다.");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTrail>(g_iStaticLevel, CTrail::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CEffectParts>(g_iStaticLevel, CEffectParts::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
@@ -390,6 +405,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBroom>(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Goblin */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin>(g_iStaticLevel, CGoblin::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXWall>(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
#include "pch.h"
|
||||
#include "Monster.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMonster::CMonster(const CMonster& Prototype)
|
||||
: CUnit(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMonster::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonster::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pPlayerTransform = static_cast<CPlayer*>(pArg)->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pPlayerTransform);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMonster::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonster::Ready_Components(void*pArg)
|
||||
{
|
||||
__super::Ready_Components(pArg);
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonster::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pPlayerTransform);
|
||||
}
|
||||
|
||||
void CMonster::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -150,12 +150,15 @@ void CNomalJap::Free()
|
||||
// SAFE_RELEASE(m_pPhysHitBox);
|
||||
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CNomalJap::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CNomalJap::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
|
||||
@@ -193,7 +193,10 @@ void CPhysXEffectHitBox::Free()
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CPhysXEffectHitBox::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -50,8 +50,10 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Parts())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
Load_KeyFrame();
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
Add_FSM();
|
||||
|
||||
@@ -70,6 +72,16 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_BasicEffect = make_unique<BasicEffect>(m_pDevice);
|
||||
m_BasicEffect->SetVertexColorEnabled(true);
|
||||
m_BasicEffect->SetView(m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW));
|
||||
m_BasicEffect->SetProjection(m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ));
|
||||
|
||||
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -82,15 +94,21 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
Update_CameraCoordinateSystem();
|
||||
#endif // _DEBUG
|
||||
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
@@ -108,8 +126,9 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CPlayer::Render()
|
||||
{
|
||||
if (!m_bVisible)
|
||||
if (!m_bVisible){
|
||||
return S_OK;
|
||||
}
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -137,10 +156,55 @@ HRESULT CPlayer::Render()
|
||||
#ifdef _DEBUG
|
||||
m_pCharacter_Controller->Render();
|
||||
//m_pRigidBody->Render();
|
||||
Render_CameraCoordinateSystem();
|
||||
#endif
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CPlayer::Render_CameraCoordinateSystem()
|
||||
{
|
||||
|
||||
|
||||
m_Batch->Begin();
|
||||
|
||||
const _float fArrowLength = 2.0f;
|
||||
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vLook = { XMVectorGetX(xmvLook), XMVectorGetZ(xmvLook) };
|
||||
|
||||
|
||||
GUI::Text("W : %.2f, %.2f, %.2f", m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z);
|
||||
GUI::Text("A : %.2f, %.2f, %.2f", -m_vCameraRightDir.x, 0.f, -m_vCameraRightDir.z);
|
||||
GUI::Text("S : %.2f, %.2f, %.2f", -m_vCameraLookDir.x, 0.f, -m_vCameraLookDir.z);
|
||||
GUI::Text("D : %.2f, %.2f, %.2f", m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z);
|
||||
|
||||
GUI::Button("##0", { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button(("W : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z })))).c_str(), {100.f, 100.f}); GUI::SameLine();
|
||||
GUI::Button("##2", {100.f, 100.f});
|
||||
GUI::Button(("A : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , -m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button("##4", { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button(("D : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z })))).c_str(), { 100.f, 100.f });
|
||||
GUI::Button("##6", {100.f, 100.f}); GUI::SameLine();
|
||||
GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { 100.f, 100.f }); GUI::SameLine();
|
||||
GUI::Button("##8", {100.f, 100.f});
|
||||
|
||||
m_Batch->DrawLine( // W
|
||||
VertexPositionColor(fArrowLength * -XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * XMLoadFloat3(&m_vCameraLookDir), DirectX::Colors::Blue)
|
||||
);
|
||||
m_Batch->DrawLine( // D
|
||||
VertexPositionColor(fArrowLength * -XMLoadFloat3(&m_vCameraRightDir), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * XMLoadFloat3(&m_vCameraRightDir), DirectX::Colors::Red)
|
||||
);
|
||||
m_Batch->DrawLine( // PlayerLook
|
||||
VertexPositionColor(XMVectorZero(), DirectX::Colors::GhostWhite),
|
||||
VertexPositionColor(fArrowLength * xmvLook, DirectX::Colors::HotPink)
|
||||
);
|
||||
|
||||
m_Batch->End();
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
HRESULT CPlayer::Ready_Components()
|
||||
{
|
||||
@@ -245,6 +309,17 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CPlayer::Update_CameraCoordinateSystem()
|
||||
{
|
||||
_vector xmvCameraLook = XMVector3Normalize(XMVectorSetY(m_pGameInstance->Get_CameraLook(), 0.f));
|
||||
_vector xmvUp = XMVectorSet(0.f, 1.f, 0.f, 0.f);
|
||||
XMStoreFloat3(&m_vCameraRightDir, XMVector3Normalize(XMVector3Cross(xmvUp, xmvCameraLook)));
|
||||
XMStoreFloat3(&m_vCameraLookDir, xmvCameraLook);
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CPlayer* pInstance = new CPlayer(pDevice, pContext);
|
||||
@@ -287,13 +362,14 @@ void CPlayer::Free()
|
||||
SAFE_RELEASE(m_pCamPosition_TopDown_LookPart);
|
||||
SAFE_RELEASE(m_pCamPosition_ShoulderPart);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CPlayer::Describe_Entity()
|
||||
{
|
||||
m_pCharacter_Controller->Describe_Entity();
|
||||
_float4 vMomentum = {};
|
||||
XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum());
|
||||
GUI::Text("%.1f %.1f %.1f %.1f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w);
|
||||
_char label[256];
|
||||
for (auto& iter : m_KeyFrames)
|
||||
{
|
||||
@@ -324,3 +400,7 @@ void CPlayer::Describe_Entity()
|
||||
GUI::Checkbox("Render", &m_bVisible);
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ void CPlayer::Behavior_IdleEnter() {
|
||||
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
@@ -145,17 +146,18 @@ HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
@@ -197,7 +199,16 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
else if (bBackward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
m_fAmount = 0.2f;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
@@ -221,11 +232,15 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount);
|
||||
m_fAmount = 1.f;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
@@ -259,7 +274,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
if (m_bSprintToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
m_pFSM->Disable_State(FSMSTATE::JOG);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else
|
||||
@@ -276,6 +291,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
if (m_bWalkToggle)
|
||||
{
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
m_pFSM->Disable_State(FSMSTATE::JOG);
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else
|
||||
@@ -289,6 +305,11 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
if (m_pModelCom->IsFinishedAnim() && m_pFSM->IsEnable(FSMSTATE::JOG))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -380,6 +401,11 @@ HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Dodge")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -619,6 +645,7 @@ void CPlayer::Set_Anim()
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
@@ -630,6 +657,7 @@ void CPlayer::Set_Anim()
|
||||
m_Animation[STATEANIM::LAND] = { 259,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE] = { 802,false };
|
||||
m_Animation[STATEANIM::DODGE_BLINK] = { 799,true };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 593,false };
|
||||
m_Animation[STATEANIM::SKILL2] = { 915,false };
|
||||
|
||||
@@ -146,7 +146,10 @@ void CSkyBox::Free()
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CSkyBox::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -38,26 +38,82 @@ void CTrailObject::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CTrailObject::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
|
||||
m_CombinedMat = m_pParentTransformCom->Get_XMWorldMatrix();
|
||||
|
||||
m_CombinedMat.r[3] += m_vOffset;
|
||||
|
||||
m_pTrailCom->Trail_Update(fTimeDelta, m_CombinedMat);
|
||||
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.y == 0)
|
||||
return;
|
||||
|
||||
m_TrailInfo.vDistortionTime.x += fTimeDelta;
|
||||
|
||||
if (m_TrailInfo.vDistortionTime.x > m_TrailInfo.vDistortionTime.y)
|
||||
{
|
||||
m_TrailInfo.vDistortionTime.x = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
void CTrailObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false)
|
||||
return;
|
||||
|
||||
if (m_TrailInfo.isBlur == true)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
||||
}
|
||||
|
||||
if (m_TrailInfo.isOnlyBlur == true)
|
||||
return;
|
||||
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::EFFECT, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTrail::TRAIL_DESC pTrailDesc;
|
||||
|
||||
pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f);
|
||||
pTrailDesc.vLow = _float3(0.f, -1.f, 0.f);
|
||||
|
||||
if (FAILED(Add_Component<CTrail>(g_iStaticLevel, &m_pTrailCom, &pTrailDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
{
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pMasking_TextureCom);
|
||||
SAFE_RELEASE(m_pNoise_TextureCom);
|
||||
SAFE_RELEASE(m_pDistortion_TextureCom);
|
||||
|
||||
_string strPerfectFilePath = pPath;
|
||||
|
||||
strPerfectFilePath += ".bin";
|
||||
strPerfectFilePath += ".trail";
|
||||
|
||||
DWORD dwByte(0);
|
||||
|
||||
@@ -78,11 +134,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_eEffectType, sizeof(EFFECT_TYPE), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
size_t iComponentLength = {};
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -99,13 +150,9 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailDiffuseName = szName;
|
||||
|
||||
m_isDiffuse = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDiffuseName),
|
||||
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
@@ -122,8 +169,6 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
|
||||
m_strTrailNoiseName = szName;
|
||||
|
||||
m_isNoise = true;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailNoiseName),
|
||||
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
|
||||
return E_FAIL;
|
||||
@@ -141,47 +186,45 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel)
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
m_isMask = true;
|
||||
m_strTrailMaskingName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailMaskingName),
|
||||
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (iComponentLength != 0)
|
||||
{
|
||||
_char szName[MAX_PATH] = {};
|
||||
|
||||
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strTrailDistortionName = szName;
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strTrailDistortionName),
|
||||
reinterpret_cast<CComponent**>(&m_pDistortion_TextureCom))))
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_pTrailCom->Load_Trail(hFile);
|
||||
|
||||
|
||||
if (!ReadFile(hFile, &m_TrailInfo, sizeof(TRAIL_INFO), &dwByte, nullptr)) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CloseHandle(hFile);
|
||||
|
||||
|
||||
MessageBox(NULL, L"트레일 로드 성공", L"System Message", MB_OK);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
if (FAILED(__super::Ready_Components(nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_POSTEX, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CTrail::TRAIL_DESC pTrailDesc;
|
||||
|
||||
pTrailDesc.vHigh = _float3(0.f, 1.f, 0.f);
|
||||
pTrailDesc.vLow = _float3(0.f, -1.f, 0.f);
|
||||
|
||||
if (FAILED(Add_Component<CTrail>(ENUM_CLASS(LEVEL::STATIC), &m_pTrailCom, &pTrailDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -199,6 +242,27 @@ HRESULT CTrailObject::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTrailObject::Render_Blur()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_POSTEX::TRAIL_BLUR))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_TrailInfo.fBlurIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_TrailInfo.iBlurWeight, sizeof(_int)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTrailCom->Render()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -238,40 +302,138 @@ void CTrailObject::Free()
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pTrailCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CTrailObject::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("VALUE");
|
||||
|
||||
_float4 vValue = {};
|
||||
|
||||
XMStoreFloat4(&vValue, m_vOffset);
|
||||
|
||||
if (GUI::InputFloat4("OFFSET", (_float*)&vValue))
|
||||
{
|
||||
m_vOffset = XMLoadFloat4(&vValue);
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
HRESULT CTrailObject::Bind_ShaderResources()
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(m_pTrailCom->Bind_Resources()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_TrailInfo.isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_isMask, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDiffuseAlpha", &m_TrailInfo.fDiffuseAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_TrailInfo.vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMask", &m_TrailInfo.isMask, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMask", &m_TrailInfo.fSoftMask, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_TrailInfo.isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseColor", &m_TrailInfo.isNoiseColor, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoiseAlpha", &m_TrailInfo.isNoiseAlpha, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseStrength", &m_TrailInfo.fNoiseStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* 디스토션 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDistortion", &m_TrailInfo.isDistortion, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDistortionTime", &m_TrailInfo.vDistortionTime, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_TrailInfo.vDiffuseDistortioUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDistortionIntensity", &m_TrailInfo.fDistortionIntensity, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskDistortionUVGainAmount", &m_TrailInfo.vMaskDistortionUVAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_TrailInfo.vEmissive, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveStrength", &m_TrailInfo.fEmissiveStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftenExp", &m_TrailInfo.fSoftenExp, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fSoftStrength", &m_TrailInfo.fSoftStrength, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCoreBoost", &m_TrailInfo.fCoreBoost, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fRadius", &m_TrailInfo.fRadius, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
@@ -293,5 +455,12 @@ HRESULT CTrailObject::Bind_ShaderResources()
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pDistortion_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pMasking_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DistortionTexture", 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Wand.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
CWand::CWand(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject(pDevice, pContext)
|
||||
@@ -30,6 +31,21 @@ HRESULT CWand::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTrailObject>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Trail"), &PartsDesc, this , &pTrail))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(pTrail->Load_Trail("../Bin/Resources/Data/Effect/Decendo/Proj_Trail" , static_cast<LEVEL>(NEXT_LEVEL))))
|
||||
return E_FAIL;
|
||||
|
||||
pTrail->Set_Target(m_pModelCom->Get_BoneMatrixPtr("root" ), XMVectorSet(0.f, 1.f, 0.f , 0.f));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -160,7 +176,10 @@ void CWand::Free()
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CWand::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -36,7 +36,9 @@ class CBombard final : public CEffect_Container
|
||||
static CBombard* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual void Free() override;
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -37,7 +37,10 @@ class CBroom final : public CGameObject
|
||||
static CBroom* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -29,8 +29,9 @@ class CCamPosition abstract : public CPartObject
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner)PURE;
|
||||
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,10 @@ class CCamPosition_Arm final : public CCamPosition
|
||||
static CCamPosition_Arm* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Arm* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -58,7 +58,11 @@ class CCamPosition_Shoulder final : public CCamPosition
|
||||
static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Shoulder* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -33,7 +33,10 @@ class CCamPosition_Socket final : public CCamPosition
|
||||
static CCamPosition_Socket* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Socket* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -31,7 +31,11 @@ class CCamPosition_Target final : public CCamPosition
|
||||
static CCamPosition_Target* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CCamPosition_Target* Clone(void* pArg, class CGameObject* pOWner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -40,7 +40,9 @@ class CCamera_Debug final : public CCamera
|
||||
static CCamera_Debug* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -36,8 +36,11 @@ class CCamera_Gaze final : public CCamera
|
||||
static CCamera_Gaze* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Client
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, END };
|
||||
enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END };
|
||||
|
||||
|
||||
@@ -46,7 +46,9 @@ class CDummy_PhysXPlayable final : public CGameObject
|
||||
static CDummy_PhysXPlayable* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -42,7 +42,10 @@ class CDummy_PhysXWall final : public CGameObject
|
||||
static CDummy_PhysXWall* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -73,14 +73,16 @@ class CEffectObject abstract : public CPartObject
|
||||
_bool isNoiseAlpha = { false };
|
||||
_bool isNomalDissolve = {};
|
||||
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
_bool isEmissiveDissolveReverse = { false };
|
||||
_bool isOnlyBlur = { false };
|
||||
|
||||
}EFFECT_INFO;
|
||||
|
||||
|
||||
@@ -31,7 +31,10 @@ class CEffectParts final : public CEffectObject
|
||||
static CEffectParts* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -44,7 +44,11 @@ class CGamePlay_Canvas final : public CCanvasObject
|
||||
static CGamePlay_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Monster.h"
|
||||
#include "CallBack_Monster_Behavior.h"
|
||||
#include "CallBack_Monster_HitReport.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CGoblin final : public CMonster
|
||||
{
|
||||
private:
|
||||
CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CGoblin(const CGoblin& Prototype);
|
||||
virtual ~CGoblin() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr };
|
||||
CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr };
|
||||
|
||||
CCharacter_Controller* m_pCharacter_Controller = { nullptr };
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CGoblin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
private:
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck();
|
||||
void Behavior_MoveExit();
|
||||
|
||||
void Behavior_CombatEnter();
|
||||
HRESULT Behavior_CombatExitCheck();
|
||||
void Behavior_CombatExit();
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -18,7 +18,7 @@ class CLevel_GamePlay final : public CLevel
|
||||
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
class CPlayer* m_pPlayerTemp = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Initialize(void* pArg);
|
||||
@@ -29,6 +29,7 @@ class CLevel_GamePlay final : public CLevel
|
||||
HRESULT Ready_Layer_Sound();
|
||||
HRESULT Ready_Layer_Player(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Monster();
|
||||
|
||||
public:
|
||||
static pair<CLevel*, function<void()>> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
|
||||
|
||||
@@ -31,7 +31,11 @@ class CLight_Main final : public CGameObject
|
||||
static CLight_Main* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Unit.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMonster abstract : public CUnit
|
||||
{
|
||||
protected:
|
||||
CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMonster(const CMonster& Prototype);
|
||||
virtual ~CMonster() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
protected:
|
||||
CTransform* m_pPlayerTransform = { nullptr };
|
||||
_float m_fTargetDistance = {};
|
||||
|
||||
protected:
|
||||
HRESULT Ready_Components(void* pArg);
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -35,7 +35,11 @@ class CNomalJap final : public CEffect_Container
|
||||
static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual void Free() override;
|
||||
CGameObject* Clone(void* pArg, CGameObject* pOwner) override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -55,7 +55,11 @@ class CPhysXEffectHitBox final : public CGameObject
|
||||
static CPhysXEffectHitBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -17,16 +17,20 @@ class CPlayer final : public CUnit
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
#ifdef _DEBUG
|
||||
void Render_CameraCoordinateSystem();
|
||||
#endif // _DEBUG
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
unordered_map<size_t, CState*> m_States = { };
|
||||
size_t m_iStateMask = { 0 };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
_float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, };
|
||||
_float3 m_vCameraRightDir = { 1.f, 0.f, 0.f };
|
||||
|
||||
|
||||
class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
@@ -43,12 +47,22 @@ class CPlayer final : public CUnit
|
||||
HRESULT Ready_Parts();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Update_CameraCoordinateSystem();
|
||||
unique_ptr<BasicEffect> m_BasicEffect;
|
||||
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch;
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
public:
|
||||
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
#pragma region STATE
|
||||
|
||||
public:
|
||||
@@ -60,12 +74,12 @@ class CPlayer final : public CUnit
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
|
||||
_float m_fAmount = { 1.f };
|
||||
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
HRESULT InputSpell();
|
||||
|
||||
STATEANIM::ESTATE m_eSpell = { STATEANIM::END };
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
void Behavior_IdleExit();
|
||||
|
||||
@@ -33,7 +33,10 @@ class CSkyBox final : public CGameObject
|
||||
static CSkyBox* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -13,6 +13,50 @@ NS_BEGIN(Client)
|
||||
|
||||
class CTrailObject final : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagTrailInfo
|
||||
{
|
||||
EFFECT_TYPE eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
/* 디퓨즈 */
|
||||
_bool isDiffuse = {};
|
||||
_float fDiffuseAlpha = { 1.f };
|
||||
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
/* 마스크 */
|
||||
_bool isMask = {};
|
||||
_float fSoftMaskEdge = {};
|
||||
_float fSoftMask = {};
|
||||
|
||||
/* 노이즈 */
|
||||
_bool isNoise = {};
|
||||
_bool isNoiseColor = { false };
|
||||
_bool isNoiseAlpha = { false };
|
||||
_float fNoiseStrength = {};
|
||||
|
||||
/* 디스 토션 */
|
||||
_bool isDistortion = {};
|
||||
_float2 vDistortionTime = {};
|
||||
_float2 vDiffuseDistortioUVAmount = {};
|
||||
_float2 vMaskDistortionUVAmount = {};
|
||||
_float fDistortionIntensity = {};
|
||||
|
||||
/* 이미시브 */
|
||||
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
|
||||
|
||||
_float fEmissiveStrength = { 0.f };
|
||||
_float fSoftenExp = { 1.31429f };
|
||||
_float fSoftStrength = {};
|
||||
_float fCoreBoost = {};
|
||||
_float fRadius = {};
|
||||
|
||||
|
||||
/* 블러 */
|
||||
_bool isBlur = {};
|
||||
_bool isOnlyBlur = { false };
|
||||
_float fBlurIntensity = {};
|
||||
_int iBlurWeight = {};
|
||||
|
||||
}TRAIL_INFO;
|
||||
private:
|
||||
CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTrailObject(const CTrailObject& rhs);
|
||||
@@ -25,23 +69,38 @@ class CTrailObject final : public CPartObject
|
||||
|
||||
public:
|
||||
HRESULT Load_Trail(const _char* pPath, LEVEL eLevel);
|
||||
void Set_Target(const _float4x4* pMatrix , _fvector v0ffset) {
|
||||
|
||||
if (pMatrix != nullptr)
|
||||
{
|
||||
m_pParantsMatrix = pMatrix;
|
||||
m_vOffset = v0ffset;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Render() override;
|
||||
virtual HRESULT Render_Blur() override;
|
||||
|
||||
|
||||
public:
|
||||
static CTrailObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pNoise_TextureCom = { nullptr };
|
||||
CTexture* m_pMasking_TextureCom = { nullptr };
|
||||
CTexture* m_pDistortion_TextureCom = { nullptr };
|
||||
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CTrail* m_pTrailCom = { nullptr };
|
||||
@@ -49,15 +108,16 @@ class CTrailObject final : public CPartObject
|
||||
_string m_strTrailDiffuseName = {};
|
||||
_string m_strTrailNoiseName = {};
|
||||
_string m_strTrailMaskingName = {};
|
||||
_string m_strTrailDistortionName = {};
|
||||
|
||||
_string m_strPath = {};
|
||||
_string m_strName = {};
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isNoise = {};
|
||||
_bool m_isMask = {};
|
||||
TRAIL_INFO m_TrailInfo = {};
|
||||
|
||||
EFFECT_TYPE m_eEffectType = { EFFECT_TYPE::TRAIL };
|
||||
const _float4x4* m_pParantsMatrix = {};
|
||||
_vector m_vOffset = {};
|
||||
_matrix m_CombinedMat = {};
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -26,11 +26,11 @@ class CWand final : public CPartObject
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
const _float4x4* m_pSocketMatrices = { };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
class CTrailObject* pTrail = { nullptr };
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
@@ -39,7 +39,10 @@ class CWand final : public CPartObject
|
||||
static CWand* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -264,5 +264,45 @@ float4x4 RotateAxis(float4 _vAxis , float fAngle)
|
||||
|
||||
}
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0, 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
#endif // ENGINE_SHADER_FUNCTIONS_HLSLI
|
||||
|
||||
@@ -556,4 +556,14 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
|
||||
pass RefitPass // 6
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,10 +30,17 @@ float2 g_fCurrent_Size;
|
||||
float2 g_fHpBG;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
float4 g_fImageUV;
|
||||
float4 g_fImageUV1;
|
||||
|
||||
float2 g_fPosition[4];
|
||||
float4 g_fImagesUV[4];
|
||||
|
||||
Texture2D g_Texture;
|
||||
Texture2D g_Texture1;
|
||||
Texture2D g_Texture2;
|
||||
Texture2D g_Texture3;
|
||||
Texture2D g_Texture4;
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
|
||||
@@ -97,6 +104,8 @@ PS_OUT PS_AlphaBlend(PS_IN In)
|
||||
|
||||
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Color.rgb *= 1.5f;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
@@ -548,6 +557,125 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Magic_Meter(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
float3 Blue = float3(41.f, 165.f, 255.f) / 255.f;
|
||||
|
||||
float4 color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord);
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord);
|
||||
|
||||
float2 reverseuv = 1.f - In.vTexcoord;
|
||||
|
||||
color = tex1;
|
||||
tex2.rgb *= Blue * 1.5f;
|
||||
|
||||
if (reverseuv.x >= g_fHp)
|
||||
{
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f)))
|
||||
color = tex2;
|
||||
|
||||
color.a *= Alpha;
|
||||
|
||||
Out.vColor = color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
PS_OUT PS_Magic_Icon(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
|
||||
float2 uv = In.vTexcoord;
|
||||
float2 center = float2(0.5, 0.5);
|
||||
float scale = 1.2;
|
||||
|
||||
uv = (uv - center) * scale + center;
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, uv);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color = tex1 * (1 - tex2.a) + tex2;
|
||||
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_RemapUV(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
float2 startUV = g_fImageUV.xy;
|
||||
float2 endUV = g_fImageUV.zw;
|
||||
|
||||
float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, atlasUV);
|
||||
|
||||
Color = tex1;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Revelio(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float2 UV = In.vTexcoord;
|
||||
|
||||
float2 Position[4];
|
||||
float2 startUV[4];
|
||||
float2 endUV[4];
|
||||
|
||||
float2 Atlases[4];
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
Position[i] = g_fPosition[i];
|
||||
startUV[i] = g_fImagesUV[i].xy;
|
||||
endUV[i] = g_fImagesUV[i].zw;
|
||||
|
||||
Atlases[i] = startUV[i] + UV * (endUV[i] - startUV[i]);
|
||||
}
|
||||
|
||||
float4 tex1 = g_Texture.Sample(DefaultSampler, UV);
|
||||
float4 tex2 = g_Texture1.Sample(DefaultSampler, Atlases[0]);
|
||||
float4 tex3 = g_Texture1.Sample(DefaultSampler, Atlases[1]);
|
||||
float4 tex4 = g_Texture2.Sample(DefaultSampler, Atlases[2]);
|
||||
float4 tex5 = g_Texture2.Sample(DefaultSampler, Atlases[3]);
|
||||
|
||||
|
||||
|
||||
//float2 atlasUV = startUV + In.vTexcoord * (endUV - startUV);
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 PosTexTechnique11
|
||||
{
|
||||
pass Default
|
||||
@@ -688,4 +816,44 @@ technique11 PosTexTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_HpBar();
|
||||
}
|
||||
pass Magic_Meter
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Meter();
|
||||
}
|
||||
|
||||
pass Magic_Icon
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Magic_Icon();
|
||||
}
|
||||
|
||||
pass RemapUV
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_RemapUV();
|
||||
}
|
||||
|
||||
pass Revelio
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Revelio();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
@@ -66,6 +67,7 @@ int g_iNoiseMoveLerpOption;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
|
||||
|
||||
int g_iMaskDistortionMoveLerpOption;
|
||||
int g_iDiffuseDistortionMoveLerpOption;
|
||||
//
|
||||
@@ -116,46 +118,7 @@ bool g_isNomalDissolve;
|
||||
|
||||
float g_fFar;
|
||||
|
||||
float2 SelectLerpUV(float2 fAmount, float _fRatio, int iSelectOption)
|
||||
{
|
||||
if (iSelectOption < 0)
|
||||
return float2(0 , 0);
|
||||
|
||||
float fRatio = _fRatio;
|
||||
switch (iSelectOption)
|
||||
{
|
||||
case 0:
|
||||
fRatio = fRatio; // Linear
|
||||
break;
|
||||
case 1:
|
||||
fRatio = fRatio * fRatio; // EaseInQuad 후반에 속도 증가
|
||||
break;
|
||||
case 2:
|
||||
fRatio = 1 - (1 - fRatio * fRatio); // EaseOutQuad 초반에 속도 증가
|
||||
break;
|
||||
case 3:
|
||||
fRatio = fRatio * fRatio * fRatio; // EaseInCubic 더 강하게 후반 속도 증가
|
||||
break;
|
||||
case 4:
|
||||
fRatio = 1 - (1 - fRatio * fRatio * fRatio); // EaseOutCubic 더 강하게 초반 속도 증가
|
||||
break;
|
||||
case 5:
|
||||
fRatio = 0.5f * (1 - cos(PI * fRatio)); // EaseInOutSin 사인 곡선
|
||||
break;
|
||||
case 6:
|
||||
fRatio = sin(13 * PI * fRatio) * (1 - fRatio) * (1 - fRatio); // EaseInBack 뒤로갔다가 앞으로
|
||||
break;
|
||||
case 7:
|
||||
fRatio = pow(2, 10 * (fRatio - 1)); // Expo 지수 함수
|
||||
break;
|
||||
case 8:
|
||||
fRatio = 1 - pow(1 - fRatio * fRatio, 0.5); // 원형 궤적
|
||||
break;
|
||||
}
|
||||
|
||||
return fAmount * fRatio;
|
||||
|
||||
}
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -358,7 +321,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
vMtrlDiffuse = saturate(g_vColor + vMtrlDiffuse);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -382,7 +345,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb;
|
||||
|
||||
}
|
||||
|
||||
/* 마스크 */
|
||||
@@ -403,7 +367,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
if (g_isMaskUVMove)
|
||||
@@ -415,7 +378,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -431,13 +394,12 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vMtrlMask.r = 1.f;
|
||||
}
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
if (g_isNomalDissolve)
|
||||
@@ -484,8 +446,6 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
@@ -506,15 +466,18 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0.05f)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
@@ -684,7 +647,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isMaskClampSample == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(ClampSampler, vMaskTexcoord);
|
||||
else
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, vMaskTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
|
||||
float fSoftMask;
|
||||
@@ -693,9 +656,7 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -703,6 +664,9 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
@@ -764,6 +728,16 @@ PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
if (g_isEmissiveDissolve == true)
|
||||
{
|
||||
fEmissiveStrength *= (1.f - In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
if (fEmissiveStrength <= 0)
|
||||
fEmissiveStrength = 0;
|
||||
|
||||
}
|
||||
|
||||
if (g_isEmissiveDissolveReverse == true)
|
||||
{
|
||||
fEmissiveStrength *= (In.vLifeTime.x / In.vLifeTime.y);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -790,7 +764,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_NON_NORMALMAP();
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
#include "Engine_Shader_Functions.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
Texture2D g_DepthTexture;
|
||||
@@ -11,14 +12,46 @@ uint g_iIndexU;
|
||||
uint g_iIndexV;
|
||||
|
||||
Texture2D g_Texture;
|
||||
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_MaskingTexture;
|
||||
Texture2D g_NoiseTexture;
|
||||
Texture2D g_DistortionTexture;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isNoise;
|
||||
/* 디퓨즈 */
|
||||
bool g_isDiffuse;
|
||||
float g_fDiffuseAlpha;
|
||||
float4 g_vColor;
|
||||
|
||||
/* 마스크 */
|
||||
bool g_isMask;
|
||||
float g_fSoftMaskEdge;
|
||||
float g_fSoftMask;
|
||||
|
||||
/* 노이즈 */
|
||||
bool g_isNoise;
|
||||
bool g_isNoiseColor;
|
||||
bool g_isNoiseAlpha;
|
||||
float g_fNoiseStrength;
|
||||
|
||||
/* 디스토션 */
|
||||
|
||||
bool g_isDistortion;
|
||||
float2 g_vDistortionTime;
|
||||
float2 g_vDiffuseDistortionUVGainAmount;
|
||||
float2 g_vMaskDistortionUVGainAmount;
|
||||
float g_fDistortionIntensity; // 디스토션 왜곡 세기
|
||||
|
||||
/* 이미시브 */
|
||||
float4 g_vEmissive;
|
||||
float g_fEmissiveStrength;
|
||||
float g_fSoftenExp;
|
||||
float g_fSoftStrength;
|
||||
float g_fCoreBoost;
|
||||
float g_fRadius;
|
||||
|
||||
/* 블러 */
|
||||
float g_fBlurIntensity;
|
||||
float g_iBlurWeight;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -121,37 +154,263 @@ PS_TRAILOUT PS_Trail(PS_IN In)
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
{
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
/* 디퓨즈 디스토션 */
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = vector(0.f, 0.f, 0.f, 1.f);
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
if (g_isMask == true)
|
||||
vMtrlMask = g_MaskingTexture.Sample(PointSampler, In.vTexcoord);
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
//vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r);
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
vMtrlDiffuse *= vMtrlNoise;
|
||||
}
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r);
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (g_isMask == true)
|
||||
{
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
float fSoftMask;
|
||||
|
||||
if (g_fSoftMask > FLT_EPSILON5)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
else
|
||||
fSoftMask = vMtrlMask.r;
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
}
|
||||
else
|
||||
vMtrlMask.r = 1.f;
|
||||
|
||||
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* 웨이트 블랜드 */
|
||||
|
||||
float fWeight = clamp(pow(In.vProjPos.w, -2.5f), 1.0f, 1000.0f);
|
||||
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * vMtrlDiffuse.a, vMtrlDiffuse.a) * fWeight;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb, vMtrlDiffuse.a) * fWeight;
|
||||
Out.vRevealage.r = vMtrlDiffuse.a;
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
|
||||
/* 이미시브 */
|
||||
|
||||
float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
float2 CenteredUV = In.vTexcoord - 0.5f;
|
||||
|
||||
float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
|
||||
float fEmissive = fSoftEdge + fCore;
|
||||
|
||||
vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vColorTarget = vEmissiveMtrl * fEmissive * g_fEmissiveStrength; // 이미시브 스트랭스
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_Position;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vBlurWeight : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_BLUR_OUT PS_TRAIL_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDistortion;
|
||||
|
||||
/* 디퓨즈 */
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
{
|
||||
/* 디퓨즈 디스토션 */
|
||||
|
||||
float2 vDiffuseTexcoord = In.vTexcoord;
|
||||
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion);
|
||||
|
||||
//0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다.
|
||||
vMtrlDistortion.rg -= 0.5f;
|
||||
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
|
||||
vDiffuseTexcoord = vDiffuseTexcoord + (vMtrlDistortion).rg * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, vDiffuseTexcoord);
|
||||
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
}
|
||||
else
|
||||
vMtrlDiffuse = g_vColor;
|
||||
|
||||
/* 노이즈 */
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (g_isNoiseAlpha)
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlNoise.r) * g_fNoiseStrength;
|
||||
|
||||
if (g_isNoiseColor)
|
||||
vMtrlDiffuse.rgb *= vMtrlNoise.rgb * g_fNoiseStrength;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 마스크 */
|
||||
|
||||
if (g_isMask == true)
|
||||
{
|
||||
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
// 마스크 디스토션
|
||||
if (g_isDistortion == true)
|
||||
{
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vDistortionUV = In.vTexcoord + SelectLerpUV(g_vMaskDistortionUVGainAmount, (g_vDistortionTime.x / g_vDistortionTime.y), 0);
|
||||
|
||||
vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV);
|
||||
|
||||
//디스토션(노이즈) 텍스쳐로 uv를 왜곡함
|
||||
vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fDistortionIntensity;
|
||||
|
||||
}
|
||||
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vMaskTexcoord);
|
||||
|
||||
float fSoftMask;
|
||||
|
||||
if (g_fSoftMask > FLT_EPSILON5)
|
||||
fSoftMask = saturate((vMtrlMask.r - g_fSoftMaskEdge) * g_fSoftMask);
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * fSoftMask);
|
||||
}
|
||||
else
|
||||
vMtrlMask = vector(1.f, 1.f, 1.f, 1.f);
|
||||
|
||||
|
||||
|
||||
|
||||
/* 디퓨즈 알파 컷*/
|
||||
|
||||
vMtrlDiffuse.a *= g_fDiffuseAlpha;
|
||||
|
||||
if (vMtrlDiffuse.a <= 0.f)
|
||||
discard;
|
||||
|
||||
///* 이미시브 */
|
||||
|
||||
//float4 vEmissiveMtrl = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
//float2 CenteredUV = In.vTexcoord - 0.5f;
|
||||
|
||||
//float fDistance = saturate(length(CenteredUV) / g_fRadius); // 마스크의 크기를 어느정도할지
|
||||
|
||||
//float fMaskAlpha = vMtrlMask.a;
|
||||
|
||||
//float fSoftEdge = pow(saturate(1.0f - fDistance), g_fSoftenExp) * g_fSoftStrength; //SoftenExp 엣지감쇠지수 , Strength
|
||||
|
||||
//float fCore = pow(saturate(1.0 - fDistance * 2.f), max(0.001, g_fCoreBoost)) * g_fCoreBoost; // CoreBust 중심강조
|
||||
|
||||
//float fEmissive = fSoftEdge + fCore;
|
||||
|
||||
//vEmissiveMtrl = g_vEmissive;
|
||||
|
||||
Out.vDiffuse = vector(vMtrlDiffuse.rgb * g_fBlurIntensity, vMtrlDiffuse.a); // 이미시브 스트랭스
|
||||
Out.vBlurWeight = g_iBlurWeight / 128.f;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -203,10 +462,20 @@ technique11 PosTexTechnique11
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
SetBlendState(BS_WB_Acc, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Trail();
|
||||
}
|
||||
|
||||
pass TrailBlur
|
||||
{
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_TRAIL_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 568 B |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 110 KiB |
|
After Width: | Height: | Size: 139 KiB |
|
After Width: | Height: | Size: 124 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |