1112
This commit is contained in:
@@ -190,3 +190,21 @@ float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndex
|
||||
float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV);
|
||||
return vOriginalUV * vDelta + vOffset;
|
||||
}
|
||||
|
||||
float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame)
|
||||
{
|
||||
float2 UV = vUV; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
return UV;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ float2 g_vDiffuseNoiseUVGainAmount;
|
||||
float2 g_vMaskNoiseUVGainAmount;
|
||||
|
||||
float2 g_vUVCutting;
|
||||
float2 g_vUVMaskCutting;
|
||||
|
||||
|
||||
float g_fBlurIntensity; //블러 세기
|
||||
float g_fNoiseDistortionIntensity; // 노이즈 왜곡 세기
|
||||
@@ -224,7 +226,8 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
/* 최종 색깔 */
|
||||
vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, UV);
|
||||
|
||||
vMtrlDiffuse += g_vColor;
|
||||
if (g_vColor.a > 0)
|
||||
vMtrlDiffuse += g_vColor;
|
||||
|
||||
if (vMtrlDiffuse.a < 0.3f)
|
||||
discard;
|
||||
@@ -299,26 +302,22 @@ VS_BLUR_OUT VS_BLUR(VS_IN In, uint iGPUIndex : SV_InstanceID)
|
||||
{
|
||||
VS_BLUR_OUT Out = (VS_BLUR_OUT) 0;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
row_major matrix matW, matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
float4 vProjPos = vector(In.vPosition, 1.f);
|
||||
|
||||
Out.vPosition = mul(vProjPos, matWVP);
|
||||
|
||||
matW = mul(g_WorldMatrix, TransformMatrix);
|
||||
matWV = mul(matW, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), matWVP);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix);
|
||||
|
||||
Out.vPosition = mul(vPosition, matWVP);
|
||||
Out.vPosition = vPosition;
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
Out.iGPUIndex = iGPUIndex;
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
|
||||
@@ -190,3 +190,21 @@ float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndex
|
||||
float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV);
|
||||
return vOriginalUV * vDelta + vOffset;
|
||||
}
|
||||
|
||||
float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame)
|
||||
{
|
||||
float2 UV = vUV; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
return UV;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,8 @@ float2 g_vDiffuseNoiseUVGainAmount;
|
||||
float2 g_vMaskNoiseUVGainAmount;
|
||||
|
||||
float2 g_vUVCutting;
|
||||
float2 g_vUVMaskCutting;
|
||||
|
||||
|
||||
float g_fBlurIntensity; //블러 세기
|
||||
float g_fNoiseDistortionIntensity; // 노이즈 왜곡 세기
|
||||
@@ -181,21 +183,9 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
{
|
||||
float2 UV = In.vTexcoord; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = g_vUVCutting.x * g_vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iCurrentFrame = int(fAnimIndex.x); // 현재 프레임이 어디 위치인지
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) g_vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) g_vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / g_vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / g_vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
UV = UV_Cutting(In.vTexcoord, g_vUVCutting, int(fAnimIndex.x));
|
||||
|
||||
if (g_isDiffuseUVMove)
|
||||
{
|
||||
@@ -240,9 +230,12 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
{
|
||||
float2 vMaskTexcoord = In.vTexcoord;
|
||||
|
||||
vMaskTexcoord = UV_Cutting(In.vTexcoord, g_vUVMaskCutting, int(fAnimIndex.x));
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
|
||||
float2 UV; // 이미지의 UV값
|
||||
|
||||
float2 vNoiseUV = In.vTexcoord + (g_vMaskNoiseUVGainAmount) * (vNoiseUVMoveTime.x / vNoiseUVMoveTime.y);
|
||||
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vNoiseUV);
|
||||
|
||||
@@ -38,6 +38,9 @@ void CEditEffect::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CEditEffect::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
Reference_Mat_For_EditEffect();
|
||||
|
||||
if(m_isBillboard)
|
||||
m_pGameInstance->BillBoard(m_pTransformCom);
|
||||
|
||||
@@ -46,7 +49,7 @@ void CEditEffect::Update(_float fTimeDelta)
|
||||
|
||||
m_pInstance_ModelCom->Drop(fTimeDelta);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -72,25 +75,24 @@ void CEditEffect::Reference_Mat_For_EditEffect()
|
||||
|
||||
if (ImGui::Combo("OPTION", &m_iSelectTextureNum, pCompute, 4))
|
||||
{
|
||||
switch (m_iSelectTextureNum)
|
||||
{
|
||||
case 0:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect(m_pDiffuse_TextureCom , this);
|
||||
break;
|
||||
case 1:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect(m_pMasking_TextureCom, this);
|
||||
break;
|
||||
case 2:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect(m_pNoise_TextureCom, this);
|
||||
break;
|
||||
case 3:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect(m_pDissolve_TextureCom, this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
switch (m_iSelectTextureNum)
|
||||
{
|
||||
case 0:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this);
|
||||
break;
|
||||
case 1:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this);
|
||||
break;
|
||||
case 2:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this);
|
||||
break;
|
||||
case 3:
|
||||
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
@@ -177,7 +179,7 @@ void CEditEffect::Describe_Entity()
|
||||
GUI::ColorEdit4("MixColor", (_float*)&m_vColor);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::InputFloat2("UVCutting", (_float*)&m_vUVCutting);
|
||||
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
if (GUI::TreeNode("BLUR"))
|
||||
@@ -235,9 +237,11 @@ void CEditEffect::Describe_Entity()
|
||||
{
|
||||
if (GUI::TreeNode("DIFFUSE"))
|
||||
{
|
||||
GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove);
|
||||
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove);
|
||||
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_vUVCutting);
|
||||
|
||||
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_vDiffuseUVGainAmount, 0.01f);
|
||||
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f);
|
||||
@@ -258,6 +262,7 @@ void CEditEffect::Describe_Entity()
|
||||
if (GUI::TreeNode("MASKING"))
|
||||
{
|
||||
|
||||
GUI::InputFloat2("MaskUVCutting", (_float*)&m_vUVMaskCutting);
|
||||
GUI::Checkbox("MaskUVMove", &m_isMaskUVMove);
|
||||
|
||||
ImGui::PushItemWidth(80);
|
||||
@@ -303,4 +308,5 @@ void CEditEffect::Describe_Entity()
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -170,6 +170,11 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_vUVMaskCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_DiffuseTexture", 0))) {
|
||||
|
||||
@@ -249,10 +249,9 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
|
||||
wifs.close();
|
||||
}
|
||||
|
||||
void CEffect_Editor::Reference_Mat_For_EditEffect(CTexture* pTexture, CGameObject* pObject)
|
||||
void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject)
|
||||
{
|
||||
|
||||
|
||||
for (auto iter : m_MatFiles)
|
||||
{
|
||||
if (GUI::TreeNode(CMyTools::ToString(iter.first).c_str()))
|
||||
@@ -263,7 +262,7 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CTexture* pTexture, CGameObjec
|
||||
m_pGameInstance->Asset_Description<CTexture>(
|
||||
ENUM_CLASS(LEVEL::EFFECT),
|
||||
CMyTools::ToString(iter.first).c_str()
|
||||
, (CComponent**)&pTexture
|
||||
, pTexture
|
||||
, nullptr
|
||||
, pObject
|
||||
, wstrTextureInfo.first // À̸§
|
||||
|
||||
@@ -40,7 +40,7 @@ class CEffectObject abstract : public CGameObject
|
||||
CInstance_Model* m_pInstance_ModelCom = { nullptr };
|
||||
|
||||
protected:
|
||||
_float4 m_vColor = { 0.f ,0.f ,0.f ,0.f };
|
||||
_float4 m_vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
_float2 m_vDiffuseUVGainAmount = {};
|
||||
_float2 m_vMaskingUVGainAmount = {};
|
||||
@@ -49,6 +49,7 @@ class CEffectObject abstract : public CGameObject
|
||||
_float2 m_vMaskNoiseUVGainAmount = {};
|
||||
|
||||
_float2 m_vUVCutting = {1.f ,1.f};
|
||||
_float2 m_vUVMaskCutting = { 1.f ,1.f };
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isMasking = {};
|
||||
|
||||
@@ -23,7 +23,7 @@ class CEffect_Editor final : public CEffectObject
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
public:
|
||||
void Reference_Mat_For_EditEffect(class CTexture* pTexture, CGameObject* pObject);
|
||||
void Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject);
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
|
||||
@@ -190,3 +190,21 @@ float2 Get_MovedUV(float2 vOriginalUV, float fDeltaU, float fDeltaV, uint iIndex
|
||||
float2 vOffset = float2(iIndexU * fDeltaU, iIndexV * fDeltaV);
|
||||
return vOriginalUV * vDelta + vOffset;
|
||||
}
|
||||
|
||||
float2 UV_Cutting(float2 vUV, float2 vUVCutting, int iCurrentFrame)
|
||||
{
|
||||
float2 UV = vUV; // 이미지의 UV값
|
||||
|
||||
int iTotalFrame = vUVCutting.x * vUVCutting.y; // 이미지의 최대 프레임 (몇 곱하기 몇인지)
|
||||
|
||||
int iFrameX = iCurrentFrame % (int) vUVCutting.x; // 현재 x축의 위치(현재 이미지의 몇번째 칸을 보여줄 지)
|
||||
int iFrameY = iCurrentFrame / (int) vUVCutting.x; // 현재 y축의 위치(현재 이미지의 몇번째 줄을 보여줄 지)
|
||||
|
||||
float fFreamWidth = 1.0 / vUVCutting.x; // 1.0 나누기 이미지 갯수를 해서 한칸에 얼마나 갈지 정해준다.
|
||||
float fFreamHeight = 1.0 / vUVCutting.y; // 1.0 나누기 이미지 갯수를 해서 한줄에 얼마나 갈지 정해준다.
|
||||
|
||||
UV.x = UV.x * fFreamWidth + iFrameX * fFreamWidth; // 먼저 uv를 0~1이 아닌 0~fFrameWidth로 만든 다음에 한칸씩 옆으로 밀어준다.
|
||||
UV.y = UV.y * fFreamHeight + iFrameY * fFreamHeight; // 먼저 uv를 0~1이 아닌 0~fFrameHeight로 만든 다음에 한줄씩 밑으로 내려준다.
|
||||
|
||||
return UV;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,20 @@ _bool CTexture::Compare_GroupName(_wstring wstrGroupName)
|
||||
return m_wstrPrototypeName == wstrGroupName;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CTexture::HoverName()
|
||||
{
|
||||
if (ImGui::IsItemHovered()) {
|
||||
|
||||
ImGui::BeginTooltip(); // 툴팁 창 시작
|
||||
|
||||
ImGui::TextUnformatted(CMyTools::ToString(m_wstrPrototypeName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천)
|
||||
|
||||
ImGui::EndTooltip(); // 툴팁 창 종료
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
HRESULT CTexture::Initialize_Prototype(TEXTURE_LOAD_TYPE eType, const _tchar* pTextureFilePath, _uint iNumTextures, _wstring wstrPrototypeName)
|
||||
{
|
||||
switch (eType)
|
||||
|
||||
@@ -116,8 +116,12 @@ class CPrototype_Manager final : public CBase
|
||||
|
||||
|
||||
*ppOut = iter->second->Clone(pDesc, pOwner);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
pTexture->HoverName();
|
||||
|
||||
if ((iIndex++ + 1) % 4 != 0)
|
||||
GUI::SameLine(); // 같은 줄에 이어서
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ class ENGINE_DLL CTexture final :
|
||||
_uint Get_Size();
|
||||
_bool Compare_GroupName(_wstring wstrGroupName);
|
||||
|
||||
#ifdef _DEBUG
|
||||
void HoverName();
|
||||
#endif
|
||||
private:
|
||||
HRESULT Initialize_Prototype(TEXTURE_LOAD_TYPE eType, const _tchar* pTextureFilePath, _uint iNumTextures, _wstring wstrPrototypeName);
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
Reference in New Issue
Block a user