@@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
Texture2D g_ColorTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == ColorTexture.a)
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
int iOption = ColorTexture.a * 10;
|
||||
int iOption = vColorTexture.a * 10;
|
||||
|
||||
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb += ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb *= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 3:
|
||||
Out.vBackBuffer.rgb -= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb -= vColorTexture.rgb;
|
||||
break;
|
||||
case 4:
|
||||
Out.vBackBuffer.rgb /= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb = ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -90,7 +94,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, 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_OUT_LASTCOLOR();
|
||||
|
||||
@@ -19,14 +19,34 @@ struct ParticleValue
|
||||
float4 vOriginLook;
|
||||
float4 vOriginTranslation;
|
||||
|
||||
float2 fPadding;
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
};
|
||||
|
||||
struct ParticleOut
|
||||
{
|
||||
float4 vRight;
|
||||
float4 vUp;
|
||||
float4 vLook;
|
||||
float4 vTranslation;
|
||||
float2 vLifeTime;
|
||||
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
|
||||
};
|
||||
|
||||
|
||||
StructuredBuffer<Particle> g_ParticleBufferInput : register(t0);
|
||||
StructuredBuffer<ParticleValue> g_ParticleValueBufferInput : register(t1);
|
||||
|
||||
RWStructuredBuffer<Particle> g_ParticleBufferOutput : register(u0);
|
||||
RWStructuredBuffer<ParticleOut> g_ParticleBufferOutput : register(u0);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
@@ -49,6 +69,9 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
ParticleOut ParticleOut;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
@@ -59,6 +82,58 @@ void CS_MAIN(
|
||||
particle.vTranslation.y = 0.f;
|
||||
}
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = particle;
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vAniTime.x >= particleValue.vAniTime.y)
|
||||
{
|
||||
particleValue.vAniTime.x = 0.f;
|
||||
|
||||
particleValue.vAniIndex.x++;
|
||||
|
||||
if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메이션에 끝에 다다랐다면
|
||||
{
|
||||
particleValue.vAniIndex.x = 0.f; // 인덱스 초기화
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//마스킹 UV 움직임 시간
|
||||
|
||||
particleValue.vMaskingUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x)
|
||||
{
|
||||
particleValue.vMaskingUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//디퓨즈 UV 움직임
|
||||
|
||||
particleValue.vDiffuseUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x)
|
||||
{
|
||||
particleValue.vDiffuseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
ParticleOut.vRight = particle.vRight;
|
||||
ParticleOut.vUp = particle.vUp;
|
||||
ParticleOut.vLook = particle.vLook;
|
||||
ParticleOut.vTranslation = particle.vTranslation;
|
||||
ParticleOut.vLifeTime = particle.vLifeTime;
|
||||
|
||||
ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime;
|
||||
ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime;
|
||||
ParticleOut.vAniTime = particleValue.vAniTime;
|
||||
ParticleOut.vAniIndex = particleValue.vAniIndex;
|
||||
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = ParticleOut;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ float g_fBlurIntensity; //블러 세기
|
||||
|
||||
float4 g_vEmissive;
|
||||
float g_fColorOption;
|
||||
float g_fEmissiveCutAlpha;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isMasking;
|
||||
@@ -98,10 +99,8 @@ struct PS_IN
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vNormal : SV_TARGET1;
|
||||
float4 vDepth : SV_TARGET2;
|
||||
float4 vColor : SV_TARGET3;
|
||||
float4 vDiffuse: SV_TARGET0;
|
||||
float4 vColorTarget : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
@@ -119,8 +118,8 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix);
|
||||
|
||||
|
||||
Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
//Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
//Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
if (vMtrlDiffuse.a < 0.3f)
|
||||
discard;
|
||||
@@ -187,20 +186,71 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
|
||||
// 색깔 추가할 처리 (이미시브)
|
||||
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha )
|
||||
Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
else
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb , g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Blur(PS_IN In)
|
||||
struct VS_BLUR_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
};
|
||||
|
||||
VS_BLUR_OUT VS_BLUR(VS_IN In)
|
||||
{
|
||||
VS_BLUR_OUT Out = (VS_BLUR_OUT) 0;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
|
||||
float4 vProjPos = vector(In.vPosition, 1.f);
|
||||
|
||||
Out.vPosition = mul(vProjPos, matWVP);
|
||||
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix);
|
||||
|
||||
Out.vPosition = mul(vPosition, matWVP);
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
};
|
||||
|
||||
|
||||
PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
|
||||
PS_OUT Out;
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
@@ -253,13 +303,8 @@ PS_OUT PS_Blur(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity;
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -291,9 +336,9 @@ technique11 DefaultTechnique
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
VertexShader = compile vs_5_0 VS_BLUR();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Blur();
|
||||
PixelShader = compile ps_5_0 PS_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
Texture2D g_ColorTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == ColorTexture.a)
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
int iOption = ColorTexture.a * 10;
|
||||
int iOption = vColorTexture.a * 10;
|
||||
|
||||
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb += ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb *= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 3:
|
||||
Out.vBackBuffer.rgb -= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb -= vColorTexture.rgb;
|
||||
break;
|
||||
case 4:
|
||||
Out.vBackBuffer.rgb /= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb = ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -90,7 +94,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, 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_OUT_LASTCOLOR();
|
||||
|
||||
@@ -19,14 +19,34 @@ struct ParticleValue
|
||||
float4 vOriginLook;
|
||||
float4 vOriginTranslation;
|
||||
|
||||
float2 fPadding;
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
};
|
||||
|
||||
struct ParticleOut
|
||||
{
|
||||
float4 vRight;
|
||||
float4 vUp;
|
||||
float4 vLook;
|
||||
float4 vTranslation;
|
||||
float2 vLifeTime;
|
||||
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
|
||||
};
|
||||
|
||||
|
||||
StructuredBuffer<Particle> g_ParticleBufferInput : register(t0);
|
||||
StructuredBuffer<ParticleValue> g_ParticleValueBufferInput : register(t1);
|
||||
|
||||
RWStructuredBuffer<Particle> g_ParticleBufferOutput : register(u0);
|
||||
RWStructuredBuffer<ParticleOut> g_ParticleBufferOutput : register(u0);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
@@ -49,6 +69,9 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
ParticleOut ParticleOut;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
@@ -59,6 +82,58 @@ void CS_MAIN(
|
||||
particle.vTranslation.y = 0.f;
|
||||
}
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = particle;
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vAniTime.x >= particleValue.vAniTime.y)
|
||||
{
|
||||
particleValue.vAniTime.x = 0.f;
|
||||
|
||||
particleValue.vAniIndex.x++;
|
||||
|
||||
if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메이션에 끝에 다다랐다면
|
||||
{
|
||||
particleValue.vAniIndex.x = 0.f; // 인덱스 초기화
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//마스킹 UV 움직임 시간
|
||||
|
||||
particleValue.vMaskingUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x)
|
||||
{
|
||||
particleValue.vMaskingUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//디퓨즈 UV 움직임
|
||||
|
||||
particleValue.vDiffuseUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x)
|
||||
{
|
||||
particleValue.vDiffuseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
ParticleOut.vRight = particle.vRight;
|
||||
ParticleOut.vUp = particle.vUp;
|
||||
ParticleOut.vLook = particle.vLook;
|
||||
ParticleOut.vTranslation = particle.vTranslation;
|
||||
ParticleOut.vLifeTime = particle.vLifeTime;
|
||||
|
||||
ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime;
|
||||
ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime;
|
||||
ParticleOut.vAniTime = particleValue.vAniTime;
|
||||
ParticleOut.vAniIndex = particleValue.vAniIndex;
|
||||
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = ParticleOut;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ PS_OUT PS_Sptire_Sheet(PS_IN In)
|
||||
|
||||
Color = Texture;
|
||||
|
||||
if (Color.r <= 0.f)
|
||||
if (Color.r <= 0.4f)
|
||||
discard;
|
||||
|
||||
Out.vColor = Color;
|
||||
|
||||
@@ -13,10 +13,13 @@ float4 g_vCamPosition;
|
||||
vector g_vColor;
|
||||
|
||||
float2 g_vUVGainAmount;
|
||||
float2 g_vUVCutting;
|
||||
|
||||
float g_fBlurIntensity; //블러 세기
|
||||
|
||||
float4 g_vEmissive;
|
||||
float g_fColorOption;
|
||||
float g_fEmissiveCutAlpha;
|
||||
|
||||
bool g_isDiffuse;
|
||||
bool g_isMasking;
|
||||
@@ -26,6 +29,24 @@ bool g_isUVMove;
|
||||
|
||||
float g_fFar;
|
||||
|
||||
struct ParticleValue
|
||||
{
|
||||
float4 vRight;
|
||||
float4 vUp;
|
||||
float4 vLook;
|
||||
float4 vTranslation;
|
||||
float2 vLifeTime;
|
||||
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
|
||||
};
|
||||
|
||||
StructuredBuffer<ParticleValue> g_ParticleValue : register(t0);
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
float3 vPosition : POSITION;
|
||||
@@ -51,9 +72,10 @@ struct VS_OUT
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
float4 vWorldPos : TEXCOORD2;
|
||||
float4 vProjPos : TEXCOORD3;
|
||||
uint iGPUIndex : TEXCOORD4;
|
||||
};
|
||||
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
VS_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_VertexID)
|
||||
{
|
||||
VS_OUT Out = (VS_OUT) 0;
|
||||
|
||||
@@ -79,7 +101,7 @@ VS_OUT VS_MAIN(VS_IN In)
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
Out.vWorldPos = mul(vector(In.vPosition, 1.f), g_WorldMatrix);
|
||||
|
||||
Out.iGPUIndex = iGPUIndex;
|
||||
|
||||
return Out;
|
||||
}
|
||||
@@ -94,14 +116,13 @@ struct PS_IN
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
float4 vWorldPos : TEXCOORD2;
|
||||
float4 vProjPos : TEXCOORD3;
|
||||
uint iGPUIndex : TEXCOORD4;
|
||||
};
|
||||
|
||||
struct PS_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
float4 vNormal : SV_TARGET1;
|
||||
float4 vDepth : SV_TARGET2;
|
||||
float4 vColor : SV_TARGET3;
|
||||
float4 vDiffuse: SV_TARGET0;
|
||||
float4 vColorTarget : SV_TARGET1;
|
||||
};
|
||||
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
@@ -119,8 +140,8 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
float3 vNormal = mul(vMtrlNormal.xyz * 2.f - 1.f, NormalMap_WorldMatrix);
|
||||
|
||||
|
||||
Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
//Out.vNormal = float4(vNormal.xyz * 0.5f + 0.5f, 0.f);
|
||||
//Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
if (vMtrlDiffuse.a < 0.3f)
|
||||
discard;
|
||||
@@ -141,11 +162,21 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDisolve;
|
||||
|
||||
float fAnimIndex = g_ParticleValue[In.iGPUIndex].vAniIndex.x;
|
||||
float2 vDiffuseTime = g_ParticleValue[In.iGPUIndex].vDiffuseUVMoveTime;
|
||||
float2 vMaskingTime = g_ParticleValue[In.iGPUIndex].vMaskingUVMoveTime;
|
||||
|
||||
|
||||
float2 vTexcoord = In.vTexcoord;
|
||||
|
||||
float2 vUVPerCell = In.vTexcoord / g_vUVCutting; //이게 한 셀당 크기
|
||||
|
||||
vTexcoord.x = vTexcoord.x * vUVPerCell.x + (fAnimIndex.x % g_vUVCutting.x) * vUVPerCell.x;
|
||||
vTexcoord.y = vTexcoord.y * vUVPerCell.y + (fAnimIndex.x / g_vUVCutting.y) * vUVPerCell.y;
|
||||
|
||||
if (g_isUVMove)
|
||||
{
|
||||
vTexcoord += g_vUVGainAmount * (In.vLifeTime.x / In.vLifeTime.y);
|
||||
vTexcoord += (g_vUVGainAmount / g_vUVCutting) * (vDiffuseTime.x / vDiffuseTime.y);
|
||||
}
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
@@ -163,7 +194,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
if (g_isMasking == true)
|
||||
{
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, vTexcoord);
|
||||
vMtrlMask = g_MaskingTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -172,7 +203,7 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
if (g_isDissolve == true)
|
||||
{
|
||||
vMtrlDisolve = g_DissolveTexture.Sample(DefaultSampler, vTexcoord);
|
||||
vMtrlDisolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -181,37 +212,88 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
|
||||
|
||||
if (g_isNoise == true)
|
||||
{
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, vTexcoord);
|
||||
vMtrlNoise = g_NoiseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
}
|
||||
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
|
||||
// 색깔 추가할 처리 (이미시브)
|
||||
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha )
|
||||
Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
else
|
||||
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb , g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_Blur(PS_IN In)
|
||||
struct VS_BLUR_OUT
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
};
|
||||
|
||||
VS_BLUR_OUT VS_BLUR(VS_IN In)
|
||||
{
|
||||
VS_BLUR_OUT Out = (VS_BLUR_OUT) 0;
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
|
||||
float4 vProjPos = vector(In.vPosition, 1.f);
|
||||
|
||||
Out.vPosition = mul(vProjPos, matWVP);
|
||||
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), TransformMatrix);
|
||||
|
||||
Out.vPosition = mul(vPosition, matWVP);
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vLifeTime = In.vLifeTime;
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_BLUR_IN
|
||||
{
|
||||
float4 vPosition : SV_POSITION;
|
||||
float2 vTexcoord : TEXCOORD0;
|
||||
float2 vLifeTime : TEXCOORD1;
|
||||
|
||||
};
|
||||
|
||||
struct PS_BLUR_OUT
|
||||
{
|
||||
float4 vDiffuse : SV_TARGET0;
|
||||
};
|
||||
|
||||
|
||||
PS_BLUR_OUT PS_BLUR(PS_BLUR_IN In)
|
||||
{
|
||||
|
||||
PS_OUT Out;
|
||||
PS_BLUR_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse;
|
||||
vector vMtrlMask;
|
||||
vector vMtrlNoise;
|
||||
vector vMtrlDisolve;
|
||||
|
||||
float2 vTexcoord = In.vTexcoord;
|
||||
float2 vTexcoord = In.vTexcoord / g_vUVCutting;
|
||||
|
||||
if (g_isUVMove)
|
||||
{
|
||||
vTexcoord += g_vUVGainAmount * (In.vLifeTime.x / In.vLifeTime.y);
|
||||
vTexcoord += g_vUVGainAmount / g_vUVCutting * (In.vLifeTime.x / In.vLifeTime.y);
|
||||
}
|
||||
|
||||
if (g_isDiffuse == true)
|
||||
@@ -253,13 +335,8 @@ PS_OUT PS_Blur(PS_IN In)
|
||||
|
||||
vMtrlDiffuse.a = saturate(vMtrlDiffuse.a * vMtrlMask.r - vMtrlDisolve.r * (In.vLifeTime.x / In.vLifeTime.y));
|
||||
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 0.0f);
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse * g_fBlurIntensity;
|
||||
|
||||
// 색깔 추가할 처리
|
||||
Out.vColor = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -291,9 +368,9 @@ technique11 DefaultTechnique
|
||||
SetRasterizerState(RS_Nocull);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
VertexShader = compile vs_5_0 VS_BLUR();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_Blur();
|
||||
PixelShader = compile ps_5_0 PS_BLUR();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
Before Width: | Height: | Size: 228 KiB |
@@ -109,7 +109,7 @@ HRESULT CActive_Icon::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Keyboard"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_ActiveMission_Icon_0"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -117,8 +117,12 @@ void CEditEffect::Describe_Entity()
|
||||
InstanceDesc.vSizeMin = _float3(1.f, 1.f, 1.f);
|
||||
InstanceDesc.vSizeMax = _float3(1.f, 1.f, 1.f);
|
||||
InstanceDesc.vSpeed = _float2(0.f, 0.f);
|
||||
InstanceDesc.vAniIndex = _float2(0.f, 32.f);
|
||||
InstanceDesc.vAniTime = _float2(1.f, 3.f);
|
||||
InstanceDesc.vDiffuseUVMoveTime = _float2(1.f, 3.f);
|
||||
InstanceDesc.vMaskingUVMoveTime = _float2(1.f, 3.f);
|
||||
|
||||
const char* pRenderNames[] = {"PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT", "BLEND" , "UI" };
|
||||
const char* pRenderNames[] = {"PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI"};
|
||||
|
||||
int iCurrentItem = static_cast<int>(m_eRenderOrder);
|
||||
|
||||
@@ -138,10 +142,15 @@ void CEditEffect::Describe_Entity()
|
||||
|
||||
GUI::ColorEdit4("Color", (_float*)&m_vColor);
|
||||
|
||||
GUI::DragFloat("BlurIntensity", &m_fBlurIntensity , 0.01f , 0.f , 1.f);
|
||||
GUI::DragFloat("BlurIntensity", &m_fBlurIntensity , 0.005f , 0.f , 1.f);
|
||||
GUI::DragFloat("EmissiveCutAlpha", &m_fEmissiveCutAlpha, 0.005f, 0.f, 1.f);
|
||||
|
||||
|
||||
GUI::ColorEdit4("Emissive", (_float*)&m_vEmissive);
|
||||
GUI::InputFloat("ColorTargetOption", &m_fColorOption);
|
||||
GUI::InputFloat2("UVCutting", (_float*)& m_vUVCutting);
|
||||
|
||||
|
||||
|
||||
GUI::DragFloat2("vUVGainAmount", (_float*)&m_vUVGainAmount , 0.01f);
|
||||
|
||||
@@ -152,7 +161,6 @@ void CEditEffect::Describe_Entity()
|
||||
//라이프 타임에 의해서가 아닌 공용시간으로 제어해야함
|
||||
//UV잘라서 적용할 수 있도록
|
||||
|
||||
//블러 웨이트도 설정할 수 있도록
|
||||
|
||||
|
||||
if (GUI::TreeNode("MODEL"))
|
||||
|
||||
@@ -46,6 +46,11 @@ HRESULT CEffectObject::Render()
|
||||
|
||||
}
|
||||
|
||||
//바인딩한 버퍼 초기화
|
||||
|
||||
ID3D11ShaderResourceView* pResetSRV[1] = { nullptr };
|
||||
m_pContext->CSSetShaderResources(0, 1, pResetSRV);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -74,6 +79,8 @@ HRESULT CEffectObject::Render_Blur()
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -93,18 +100,23 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_isMasking, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_isDissolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_isUVMove", &m_isUVMove, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_vColor, sizeof(_float4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -117,11 +129,20 @@ HRESULT CEffectObject::Bind_ShaderResources()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_fEmissiveCutAlpha, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVGainAmount", &m_vUVGainAmount, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_vUVCutting, sizeof(_float2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(FAILED(m_pInstance_ModelCom->Bind_CS_Output(0)))
|
||||
return E_FAIL;
|
||||
|
||||
if (m_pDiffuse_TextureCom != nullptr)
|
||||
{
|
||||
|
||||
@@ -83,23 +83,9 @@ HRESULT CGamePlay_Canvas::Bind_ShaderResources()
|
||||
|
||||
HRESULT CGamePlay_Canvas::Ready_Components(void* pArg)
|
||||
{
|
||||
|
||||
|
||||
if (FAILED(Add_Component<CVIBuffer_Rect>(g_iStaticLevel, &m_pVIBufferCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &Mission_Panel)))
|
||||
//{
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMiniMap_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &Minimap_Panel)))
|
||||
//{
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
|
||||
CGameObject* asdf = this;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -108,10 +94,20 @@ HRESULT CGamePlay_Canvas::Ready_Panel(void* pArg)
|
||||
{
|
||||
CGameObject* asdf = this;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoading_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &Loading_Panel)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoading_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoading_Panel)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Panel(TEXT("LoadingPanel"), m_pLoading_Panel);
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMiniMap_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMinimap_Panel)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Panel(TEXT("Minimap"), m_pMinimap_Panel);
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &Mission_Panel)))
|
||||
//{
|
||||
// return E_FAIL;
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include "IMGUIUI.h"
|
||||
#include "UIObject.h"
|
||||
#include "GamePlay_Canvas.h"
|
||||
#include "PanelObject.h"
|
||||
#include "ElementObject.h"
|
||||
#include "Mouse_Cursor.h"
|
||||
|
||||
CIMGUIUI::CIMGUIUI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
@@ -25,69 +28,206 @@ HRESULT CIMGUIUI::Initialize(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
|
||||
{
|
||||
m_iPanelNamestring.clear();
|
||||
m_iPanelName.clear();
|
||||
m_iPanelNamewstring.clear();
|
||||
|
||||
m_iPanelNamewstring = panelNames;
|
||||
|
||||
for (auto& wname : panelNames)
|
||||
{
|
||||
// wstring -> UTF-8 string 변환
|
||||
int size = WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
nullptr, 0, nullptr, nullptr);
|
||||
|
||||
std::string result(size, 0);
|
||||
|
||||
WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
&result[0], size, nullptr, nullptr);
|
||||
|
||||
// 변환된 string 저장
|
||||
m_iPanelNamestring.push_back(std::move(result));
|
||||
}
|
||||
|
||||
// vector<const char*> 업데이트
|
||||
for (auto& str : m_iPanelNamestring)
|
||||
m_iPanelName.push_back(str.c_str());
|
||||
}
|
||||
|
||||
void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
|
||||
{
|
||||
m_pElementNamestring.clear();
|
||||
m_pElementName.clear();
|
||||
m_pElementNamewstring.clear();
|
||||
|
||||
m_pElementNamewstring = panelNames;
|
||||
|
||||
for (auto& wname : panelNames)
|
||||
{
|
||||
// wstring -> UTF-8 string 변환
|
||||
int size = WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
nullptr, 0, nullptr, nullptr);
|
||||
|
||||
std::string result(size, 0);
|
||||
|
||||
WideCharToMultiByte(CP_UTF8, 0,
|
||||
wname.c_str(), (int)wname.size(),
|
||||
&result[0], size, nullptr, nullptr);
|
||||
|
||||
// 변환된 string 저장
|
||||
m_pElementNamestring.push_back(std::move(result));
|
||||
}
|
||||
|
||||
// vector<const char*> 업데이트
|
||||
for (auto& str : m_pElementNamestring)
|
||||
m_pElementName.push_back(str.c_str());
|
||||
}
|
||||
|
||||
void CIMGUIUI::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CIMGUIUI::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pElementObject != nullptr)
|
||||
if (m_pPanelObject != nullptr)
|
||||
{
|
||||
m_fPos.x = static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[0];
|
||||
m_fPos.y = static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[1];
|
||||
m_fPanelPos.x = static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[0];
|
||||
m_fPanelPos.y = static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[1];
|
||||
|
||||
m_fSize.x = static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().x;
|
||||
m_fSize.y = static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().y;
|
||||
m_fPanelSize.x = static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Size().x;
|
||||
m_fPanelSize.y = static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Size().y;
|
||||
|
||||
m_fSizeXY = static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size();
|
||||
|
||||
m_fTimeMult = static_cast<CUIObject*>(m_pElementObject)->Get_TimeMult();
|
||||
m_fPanelSizeXY = static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Size();
|
||||
|
||||
m_fPanelTimeMult = static_cast<CPanelObject*>(m_pPanelObject)->Get_TimeMult();
|
||||
}
|
||||
GUI::Begin("Current_UIObject_Info");
|
||||
|
||||
if (m_pElementObject != nullptr)
|
||||
{
|
||||
GUI::Text("Origin Position : %.1f, %.1f", static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Position().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Position().y);
|
||||
GUI::Text("Current Position : %.1f, %.1f", static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[0], static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[1]);
|
||||
GUI::Text("Origin Size : %.1f, %.1f", static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Size().y);
|
||||
GUI::Text("Current Size : %.1f, %.1f", static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().y);
|
||||
m_fPos.x = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Position().m128_f32[0];
|
||||
m_fPos.y = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Position().m128_f32[1];
|
||||
|
||||
m_fSize.x = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size().x;
|
||||
m_fSize.y = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size().y;
|
||||
|
||||
m_fSizeXY = static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size();
|
||||
|
||||
m_fTimeMult = static_cast<CElementObject*>(m_pElementObject)->Get_TimeMult();
|
||||
}
|
||||
GUI::Begin("Current_PanelObject_Info");
|
||||
if (m_pGamePlay_Canvas != nullptr)
|
||||
{
|
||||
if (m_pGamePlay_Canvas != nullptr)
|
||||
{
|
||||
auto panelNames = static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Panel_Name();
|
||||
PanelwstringTostring(panelNames);
|
||||
if (GUI::Combo("Panels", &m_iPanelCount, m_iPanelName.data(), static_cast<_int>(m_iPanelName.size())))
|
||||
{
|
||||
m_pPanelObject = static_cast<CCanvasObject*>(m_pGamePlay_Canvas)->Get_Panel(m_iPanelNamewstring[m_iPanelCount]);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pPanelObject != nullptr)
|
||||
{
|
||||
GUI::Text("Origin Position : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Origin_Position().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Origin_Position().y);
|
||||
GUI::Text("Current Position : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[0], static_cast<CUIObject*>(m_pPanelObject)->Get_Current_Position().m128_f32[1]);
|
||||
GUI::Text("Origin Size : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Origin_Size().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Origin_Size().y);
|
||||
GUI::Text("Current Size : %.1f, %.1f", static_cast<CPanelObject*>(m_pPanelObject)->Get_Current_Size().x, static_cast<CUIObject*>(m_pPanelObject)->Get_Current_Size().y);
|
||||
|
||||
GUI::Text("PanelPosition");
|
||||
if (GUI::SliderFloat("X##PanelPos", &m_fPanelPos.x, 0.f, 1920.f))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->MoveX(m_fPanelPos.x);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##PanelPos", &m_fPanelPos.y, 0.f, 1080))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->MoveY(m_fPanelPos.y);
|
||||
}
|
||||
|
||||
GUI::Text("PanelSize");
|
||||
if (GUI::SliderFloat("X##PanelSize", &m_fPanelSize.x, 1.f, 1920.f))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->SizeUpdate(m_fPanelSize.x, m_fPanelSize.y);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##PanelSize", &m_fPanelSize.y, 1.f, 1080.f))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->SizeUpdate(m_fPanelSize.x, m_fPanelSize.y);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("PanelSize", &m_fPanelSizeXY.x, 1.f, 1980.f))
|
||||
{
|
||||
m_fPanelSizeXY.y = m_fPanelSizeXY.x;
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->SizeUpdate_float(m_fPanelSizeXY);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("PanelTimeMult", &m_fPanelTimeMult, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CPanelObject*>(m_pPanelObject)->Set_TimeMult(m_fPanelTimeMult);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
|
||||
GUI::Begin("Current_ElementObject_Info");
|
||||
if (m_pPanelObject != nullptr)
|
||||
{
|
||||
auto ElementNames = static_cast<CPanelObject*>(m_pPanelObject)->Element_Name();
|
||||
ElementwstringTostring(ElementNames);
|
||||
if (GUI::Combo("Element", &m_iElementCount, m_pElementName.data(), static_cast<_int>(m_pElementName.size())))
|
||||
{
|
||||
m_pElementObject = static_cast<CPanelObject*>(m_pPanelObject)->Get_Element(m_pElementNamewstring[m_iElementCount]);
|
||||
}
|
||||
}
|
||||
if (m_pElementObject != nullptr)
|
||||
{
|
||||
GUI::Text("Origin Position : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Origin_Position().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Position().y);
|
||||
GUI::Text("Current Position : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Current_Position().m128_f32[0], static_cast<CUIObject*>(m_pElementObject)->Get_Current_Position().m128_f32[1]);
|
||||
GUI::Text("Origin Size : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Origin_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Origin_Size().y);
|
||||
GUI::Text("Current Size : %.1f, %.1f", static_cast<CElementObject*>(m_pElementObject)->Get_Current_Size().x, static_cast<CUIObject*>(m_pElementObject)->Get_Current_Size().y);
|
||||
|
||||
GUI::Text("Position");
|
||||
if (GUI::SliderFloat("X##Pos", &m_fPos.x, 0.f, 1920.f))
|
||||
{
|
||||
static_cast<CUIObject*>(m_pElementObject)->MoveX(m_fPos.x);
|
||||
static_cast<CElementObject*>(m_pElementObject)->MoveX(m_fPos.x);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##Pos", &m_fPos.y, 0.f, 1080))
|
||||
{
|
||||
static_cast<CUIObject*>(m_pElementObject)->MoveY(m_fPos.y);
|
||||
static_cast<CElementObject*>(m_pElementObject)->MoveY(m_fPos.y);
|
||||
}
|
||||
|
||||
GUI::Text("Size");
|
||||
if (GUI::SliderFloat("X##Size", &m_fSize.x, 1.f, 1920.f))
|
||||
{
|
||||
static_cast<CUIObject*>(m_pElementObject)->SizeUpdate(m_fSize.x, m_fSize.y);
|
||||
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate(m_fSize.x, m_fSize.y);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Y##Size", &m_fSize.y, 1.f, 1080.f))
|
||||
{
|
||||
static_cast<CUIObject*>(m_pElementObject)->SizeUpdate(m_fSize.x, m_fSize.y);
|
||||
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate(m_fSize.x, m_fSize.y);
|
||||
}
|
||||
|
||||
if (GUI::SliderFloat("Size", &m_fSizeXY.x, 1.f, 1980.f))
|
||||
{
|
||||
m_fSizeXY.y = m_fSizeXY.x;
|
||||
static_cast<CUIObject*>(m_pElementObject)->SizeUpdate_float(m_fSizeXY);
|
||||
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate_float(m_fSizeXY);
|
||||
}
|
||||
|
||||
if (GUI::DragFloat("TimeMult", &m_fTimeMult, 0.01f, 0.f, 10.f))
|
||||
{
|
||||
static_cast<CUIObject*>(m_pElementObject)->Set_TimeMult(m_fTimeMult);
|
||||
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fTimeMult);
|
||||
}
|
||||
}
|
||||
GUI::End();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void CIMGUIUI::Late_Update(_float fTimeDelta)
|
||||
@@ -110,6 +250,7 @@ HRESULT CIMGUIUI::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,11 +27,11 @@
|
||||
#include "Mission_Key.h"
|
||||
#include "Mission_KeyHold.h"
|
||||
#include "Mouse_Cursor.h"
|
||||
|
||||
#include "MiniMap_TrimBorder.h"
|
||||
#include "Active_Icon.h"
|
||||
|
||||
#include "MiniMap_Panel.h"
|
||||
#include "MiniMap_TrimBorder.h"
|
||||
|
||||
#include "Loading_Panel.h"
|
||||
#include "LoadingWidget.h"
|
||||
@@ -233,73 +233,64 @@ HRESULT CLoader::Loading_For_UI()
|
||||
|
||||
m_strMessage = TEXT("Texture Loading..");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Keyboard"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Keyboard/Keyboard_%d.png"), 10)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LodingWidget1"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Loading", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Border"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Border.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Key"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Key.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Finishi_Rect"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Finishi_Rect.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Main"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Mission_Main.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("ActiveMission_Icon"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/ActiveMission_Icon_%d.png"), 2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
});
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Mission", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
|
||||
{
|
||||
|
||||
_string strFilePath = pFilePath;
|
||||
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
|
||||
});
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("HUD_MiniMap_TrimBorder"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/MiniMap/HUD_MiniMap_TrimBorder.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Icon"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/Mission_Icon_%d.png"), 2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("ActiveMission_Icon"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/MiniMap/ActiveMission_Icon_%d.png"), 2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Icon_"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/MiniMap/Mission_Icon_%d.png"), 2)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("HUD_MiniMap_TrimBorder"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/MiniMap/HUD_MiniMap_TrimBorder.png"), 0)))) {
|
||||
return E_FAIL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
m_strMessage = TEXT("Shader Loading..");
|
||||
|
||||
@@ -129,7 +129,7 @@ HRESULT CLoadingWidget::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("LodingWidget1"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_LoadingWidget"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ HRESULT CLoadingWidget_Flame::Bind_ShaderResources()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -129,7 +129,7 @@ HRESULT CLoadingWidget_Flame::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("LodingWidget1"), reinterpret_cast<CComponent**>(&m_pTextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_LoadingWidget_Flame"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -171,7 +171,7 @@ void CLoadingWidget_Flame::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pTextureCom);
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ HRESULT CLoading_Panel::Initialize(void* pArg)
|
||||
{
|
||||
CUIObject::UIOBJECT_DESC Desc{};
|
||||
|
||||
Desc.fX = 1920.f;
|
||||
Desc.fY = 1080.f;
|
||||
Desc.fX = 0.f;
|
||||
Desc.fY = 0.f;
|
||||
Desc.fSizeX = 100.f;
|
||||
Desc.fSizeY = 100.f;
|
||||
|
||||
@@ -36,6 +36,10 @@ HRESULT CLoading_Panel::Initialize(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Element(pArg)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -113,7 +117,7 @@ HRESULT CLoading_Panel::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Keyboard"), reinterpret_cast<CComponent**>(&m_pTextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Keyboard_0"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -125,6 +129,22 @@ HRESULT CLoading_Panel::Ready_Components(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoading_Panel::Ready_Element(void* pArg)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoadingWidget>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget);
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoadingWidget_Flame>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget_Flame)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Element(TEXT("LoadingWidget_Flame"), m_pLoadingWidget_Flame);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CLoading_Panel* CLoading_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CLoading_Panel* pInstance = new CLoading_Panel(pDevice, pContext);
|
||||
|
||||
@@ -41,10 +41,12 @@ HRESULT CMiniMap_Panel::Initialize(void* pArg)
|
||||
|
||||
void CMiniMap_Panel::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMiniMap_Panel::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMiniMap_Panel::Late_Update(_float fTimeDelta)
|
||||
@@ -53,6 +55,7 @@ void CMiniMap_Panel::Late_Update(_float fTimeDelta)
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::UI, this, *vPos, m_pTransformCom->Get_Radius());
|
||||
}
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CMiniMap_Panel::Render()
|
||||
@@ -92,7 +95,7 @@ HRESULT CMiniMap_Panel::Bind_ShaderResources()
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pTextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
|
||||
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -105,9 +108,27 @@ HRESULT CMiniMap_Panel::Bind_ShaderResources()
|
||||
|
||||
HRESULT CMiniMap_Panel::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(Add_Component<CVIBuffer_Rect>(g_iStaticLevel, &m_pVIBufferCom)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Keyboard_0"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMiniMap_Panel::Ready_Element(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMiniMap_Panel* CMiniMap_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CMiniMap_Panel* pInstance = new CMiniMap_Panel(pDevice, pContext);
|
||||
@@ -138,7 +159,7 @@ void CMiniMap_Panel::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pTextureCom);
|
||||
SAFE_RELEASE(m_pDiffuse_TextureCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ HRESULT CMissionBanner_Border::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Cursor"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_MissionBanner_Border"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ HRESULT CMissionBanner_Key::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("MissionBanner_Key"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_MissionBanner_Key"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ HRESULT CMission_Icon::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Cursor"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Mission_Icon_0"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ HRESULT CMission_Key::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Keyboard"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_MissionBanner_Key"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ HRESULT CMission_KeyHold::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Finishi_Rect"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Finishi_Rect"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ void CMouse_Cursor::Priority_Update(_float fTimeDelta)
|
||||
void CMouse_Cursor::Update(_float fTimeDelta)
|
||||
{
|
||||
m_fTime += fTimeDelta;
|
||||
//ShowCursor(false);
|
||||
/*ShowCursor(false);*/
|
||||
}
|
||||
|
||||
void CMouse_Cursor::Late_Update(_float fTimeDelta)
|
||||
@@ -57,7 +57,7 @@ void CMouse_Cursor::Late_Update(_float fTimeDelta)
|
||||
POINT m_pPt{};
|
||||
GetCursorPos(&m_pPt);
|
||||
ScreenToClient(g_hWnd, &m_pPt);
|
||||
_vector MousePos = XMVectorSet(static_cast<_float>(m_pPt.x - m_fWinSizeX * 0.5), static_cast<_float>(-m_pPt.y + m_fWinSizeY * 0.5), 0.f, 1.f);
|
||||
_vector MousePos = XMVectorSet(static_cast<_float>(m_pPt.x - m_fWinSizeX * 0.5), static_cast<_float>(-m_pPt.y + m_fWinSizeY * 0.5) - 10.f, 0.f, 1.f);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, MousePos);
|
||||
|
||||
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
|
||||
|
||||
@@ -43,6 +43,7 @@ class CEffectObject abstract : public CGameObject
|
||||
_float4 m_vColor = { 0.f ,0.f ,0.f ,1.f };
|
||||
|
||||
_float2 m_vUVGainAmount = {};
|
||||
_float2 m_vUVCutting = {1.f ,1.f};
|
||||
|
||||
_bool m_isDiffuse = {};
|
||||
_bool m_isMasking = {};
|
||||
@@ -54,8 +55,10 @@ class CEffectObject abstract : public CGameObject
|
||||
_float4 m_vEmissive = { 0.f ,0.f ,0.f ,0.f};
|
||||
_float m_fColorOption = {};
|
||||
_float m_fBlurIntensity = {};
|
||||
_float m_fEmissiveCutAlpha = {};
|
||||
|
||||
RENDER m_eRenderOrder = {RENDER::NONLIGHT};
|
||||
|
||||
RENDER m_eRenderOrder = {RENDER::EFFECT};
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -35,9 +35,9 @@ class CGamePlay_Canvas final : public CCanvasObject
|
||||
|
||||
private:
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
//CGameObject* Mission_Panel = { nullptr };
|
||||
//CGameObject* Minimap_Panel = { nullptr };
|
||||
CGameObject* Loading_Panel = { nullptr };
|
||||
//CGameObject* m_pMission_Panel = { nullptr };
|
||||
CGameObject* m_pMinimap_Panel = { nullptr };
|
||||
CGameObject* m_pLoading_Panel = { nullptr };
|
||||
|
||||
public:
|
||||
static CGamePlay_Canvas* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -30,13 +30,32 @@ class CIMGUIUI final : public CGameObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
CGameObject* m_pGamePlay_Canvas = { nullptr };
|
||||
CGameObject* m_pPanelObject = { nullptr };
|
||||
CGameObject* m_pElementObject = { nullptr };
|
||||
_float2 m_fPos{};
|
||||
_float2 m_fSize{};
|
||||
_float3 m_fSizeXY{};
|
||||
_float m_fTimeMult{};
|
||||
void PanelwstringTostring(vector<wstring>& panelNames);
|
||||
void ElementwstringTostring(vector<wstring>& panelNames);
|
||||
|
||||
private:
|
||||
CGameObject* m_pGamePlay_Canvas = { nullptr };
|
||||
CGameObject* m_pPanelObject = { nullptr };
|
||||
CGameObject* m_pElementObject = { nullptr };
|
||||
_float2 m_fPos{};
|
||||
_float2 m_fSize{};
|
||||
_float3 m_fSizeXY{};
|
||||
_float m_fTimeMult{};
|
||||
|
||||
_float2 m_fPanelPos{};
|
||||
_float2 m_fPanelSize{};
|
||||
_float3 m_fPanelSizeXY{};
|
||||
_float m_fPanelTimeMult{};
|
||||
|
||||
_int m_iElementCount{};
|
||||
vector<wstring> m_pElementNamewstring;
|
||||
vector<string> m_pElementNamestring;
|
||||
vector<const _char*> m_pElementName;
|
||||
|
||||
_int m_iPanelCount{};
|
||||
vector<wstring> m_iPanelNamewstring;
|
||||
vector<string> m_iPanelNamestring;
|
||||
vector<const _char*> m_iPanelName;
|
||||
|
||||
public:
|
||||
static CIMGUIUI* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -27,7 +27,7 @@ class CLoadingWidget_Flame final : public CElementObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
CTexture* m_pTextureCom = { nullptr };
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
|
||||
|
||||
@@ -26,17 +26,17 @@ class CLoading_Panel final : public CPanelObject
|
||||
private:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Ready_Element(void* pArg) override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
CTexture* m_pTextureCom = { nullptr };
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
CGameObject* m_pMission_KeyHold = { nullptr };
|
||||
CGameObject* m_pMission_Key = { nullptr };
|
||||
CGameObject* m_pActive_Icon = { nullptr };
|
||||
CGameObject* m_pMissionBanner_Key = { nullptr };
|
||||
CGameObject* m_pLoadingWidget = { nullptr };
|
||||
CGameObject* m_pLoadingWidget_Flame = { nullptr };
|
||||
|
||||
|
||||
public:
|
||||
static CLoading_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -26,6 +26,7 @@ class CMiniMap_Panel final : public CPanelObject
|
||||
private:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Ready_Element(void* pArg) override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
@@ -33,6 +34,10 @@ class CMiniMap_Panel final : public CPanelObject
|
||||
CTexture* m_pTextureCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
CGameObject* m_pMission_KeyHold = { nullptr };
|
||||
CGameObject* m_pMission_Key = { nullptr };
|
||||
CGameObject* m_pActive_Icon = { nullptr };
|
||||
CGameObject* m_pMissionBanner_Key = { nullptr };
|
||||
|
||||
public:
|
||||
static CMiniMap_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
|
||||
@@ -303,7 +303,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float)i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
@@ -329,7 +329,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In)
|
||||
vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x;
|
||||
vTexcoord.y = In.vTexcoord.y;
|
||||
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord);
|
||||
vColor += g_fWeights[i + 6] * g_BlurTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBlurX = vColor;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
Texture2D g_ColorTexture;
|
||||
Texture2D g_DiffuseTexture;
|
||||
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -48,39 +50,41 @@ PS_OUT_BACKBUFFER PS_OUT_LASTCOLOR(PS_IN In)
|
||||
|
||||
Out.vBackBuffer = float4(0.f, 0.f, 0.f, 0.f);
|
||||
|
||||
vector ColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vector vColorTexture = g_ColorTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == ColorTexture.a)
|
||||
vector vDiffuseTexture = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
if (0.f == vColorTexture.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
int iOption = ColorTexture.a * 10;
|
||||
int iOption = vColorTexture.a * 10;
|
||||
|
||||
|
||||
switch (iOption)
|
||||
{
|
||||
case 1:
|
||||
Out.vBackBuffer.rgb += ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb = vColorTexture.rgb;
|
||||
break;
|
||||
case 2:
|
||||
Out.vBackBuffer.rgb *= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb *= vColorTexture.rgb;
|
||||
break;
|
||||
case 3:
|
||||
Out.vBackBuffer.rgb -= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb -= vColorTexture.rgb;
|
||||
break;
|
||||
case 4:
|
||||
Out.vBackBuffer.rgb /= ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb /= vColorTexture.rgb;
|
||||
break;
|
||||
case 5:
|
||||
Out.vBackBuffer.rgb = ColorTexture.rgb;
|
||||
Out.vBackBuffer.rgb += vColorTexture.rgb;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
@@ -90,7 +94,7 @@ technique11 DefaultTechnique
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, 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_OUT_LASTCOLOR();
|
||||
|
||||
@@ -19,14 +19,34 @@ struct ParticleValue
|
||||
float4 vOriginLook;
|
||||
float4 vOriginTranslation;
|
||||
|
||||
float2 fPadding;
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
};
|
||||
|
||||
struct ParticleOut
|
||||
{
|
||||
float4 vRight;
|
||||
float4 vUp;
|
||||
float4 vLook;
|
||||
float4 vTranslation;
|
||||
float2 vLifeTime;
|
||||
|
||||
float2 vMaskingUVMoveTime;
|
||||
float2 vDiffuseUVMoveTime;
|
||||
float2 vAniTime;
|
||||
|
||||
float2 vAniIndex;
|
||||
|
||||
};
|
||||
|
||||
|
||||
StructuredBuffer<Particle> g_ParticleBufferInput : register(t0);
|
||||
StructuredBuffer<ParticleValue> g_ParticleValueBufferInput : register(t1);
|
||||
|
||||
RWStructuredBuffer<Particle> g_ParticleBufferOutput : register(u0);
|
||||
RWStructuredBuffer<ParticleOut> g_ParticleBufferOutput : register(u0);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐이더 바인딩할때 인덱스가 동일해야함
|
||||
{
|
||||
@@ -49,6 +69,9 @@ void CS_MAIN(
|
||||
|
||||
ParticleValue particleValue = g_ParticleValueBufferInput[iIndex];
|
||||
|
||||
ParticleOut ParticleOut;
|
||||
|
||||
// 라이프타임 움직임
|
||||
particle.vTranslation.y -= particleValue.fSpeed * fTimeDelta;
|
||||
|
||||
particle.vLifeTime.x += fTimeDelta;
|
||||
@@ -59,6 +82,58 @@ void CS_MAIN(
|
||||
particle.vTranslation.y = 0.f;
|
||||
}
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = particle;
|
||||
|
||||
//애니메이션 속도 , 인덱스
|
||||
|
||||
particleValue.vAniTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vAniTime.x >= particleValue.vAniTime.y)
|
||||
{
|
||||
particleValue.vAniTime.x = 0.f;
|
||||
|
||||
particleValue.vAniIndex.x++;
|
||||
|
||||
if (particleValue.vAniIndex.x > particleValue.vAniIndex.y) // 애니메이션에 끝에 다다랐다면
|
||||
{
|
||||
particleValue.vAniIndex.x = 0.f; // 인덱스 초기화
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//마스킹 UV 움직임 시간
|
||||
|
||||
particleValue.vMaskingUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vMaskingUVMoveTime.x >= particleValue.vMaskingUVMoveTime.x)
|
||||
{
|
||||
particleValue.vMaskingUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//디퓨즈 UV 움직임
|
||||
|
||||
particleValue.vDiffuseUVMoveTime.x += fTimeDelta;
|
||||
|
||||
if (particleValue.vDiffuseUVMoveTime.x >= particleValue.vDiffuseUVMoveTime.x)
|
||||
{
|
||||
particleValue.vDiffuseUVMoveTime.x = 0.f;
|
||||
}
|
||||
|
||||
|
||||
//아웃풋 대입
|
||||
|
||||
ParticleOut.vRight = particle.vRight;
|
||||
ParticleOut.vUp = particle.vUp;
|
||||
ParticleOut.vLook = particle.vLook;
|
||||
ParticleOut.vTranslation = particle.vTranslation;
|
||||
ParticleOut.vLifeTime = particle.vLifeTime;
|
||||
|
||||
ParticleOut.vMaskingUVMoveTime = particleValue.vMaskingUVMoveTime;
|
||||
ParticleOut.vDiffuseUVMoveTime = particleValue.vDiffuseUVMoveTime;
|
||||
ParticleOut.vAniTime = particleValue.vAniTime;
|
||||
ParticleOut.vAniIndex = particleValue.vAniIndex;
|
||||
|
||||
|
||||
g_ParticleBufferOutput[iIndex] = ParticleOut;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,16 @@ CGameObject* CCanvasObject::Get_Panel(const wstring& Name)
|
||||
return Find_Panel(Name);
|
||||
}
|
||||
|
||||
_int CCanvasObject::Panels_Count()
|
||||
{
|
||||
return m_iPanel_Count;
|
||||
}
|
||||
|
||||
const vector<wstring> CCanvasObject::Panel_Name()
|
||||
{
|
||||
return m_PanelNames;
|
||||
}
|
||||
|
||||
void CCanvasObject::Add_Panel(wstring Name, CGameObject* pPanel)
|
||||
{
|
||||
if (pPanel == nullptr)
|
||||
@@ -95,7 +105,9 @@ void CCanvasObject::Add_Panel(wstring Name, CGameObject* pPanel)
|
||||
}
|
||||
|
||||
m_Panels.push_back(pPanel);
|
||||
m_PanelNames.push_back(Name);
|
||||
m_Panels_map.emplace(Name, pPanel);
|
||||
m_iPanel_Count++;
|
||||
}
|
||||
|
||||
CGameObject* CCanvasObject::Find_Panel(const wstring& Name)
|
||||
|
||||
@@ -33,7 +33,7 @@ HRESULT CComputeShader::Initialize(const _tchar* pShaderFilePath, const _char* p
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer)
|
||||
D3D11_MAPPED_SUBRESOURCE CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer)
|
||||
{
|
||||
//VBBuffer-> dynamic , pConstantBuffer-> dynamic , m_pInputBuffer, m_pOutputBuffer-> default , m_pStagingBuffer-> Staging
|
||||
|
||||
@@ -71,28 +71,22 @@ HRESULT CComputeShader::Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGrou
|
||||
|
||||
//디폴트-> 스테이징 버퍼는 복사가 가능함 (다이나믹은 cpu 기반이라 복사 안됨)
|
||||
//0번 스테이징 버퍼가 아우풋 스테이징 버퍼와 같음
|
||||
m_pContext->CopyResource(m_pStagingBuffer[0], m_pOutputBuffer);
|
||||
m_pContext->CopyResource(m_pOutputStagingBuffer, m_pOutputBuffer);
|
||||
|
||||
//스테이징 버퍼를 열어서 카피함
|
||||
D3D11_MAPPED_SUBRESOURCE StagingSubResource = {};
|
||||
D3D11_MAPPED_SUBRESOURCE OutSubResource = {};
|
||||
//D3D11_MAPPED_SUBRESOURCE OutSubResource = {};
|
||||
|
||||
if (SUCCEEDED(m_pContext->Map(m_pStagingBuffer[0], 0, D3D11_MAP_READ, 0, &StagingSubResource)))
|
||||
if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer, 0, D3D11_MAP_READ, 0, &StagingSubResource)))
|
||||
{
|
||||
if (SUCCEEDED(m_pContext->Map(ppBuffers[0], 0, D3D11_MAP_WRITE_DISCARD, 0, &OutSubResource)))
|
||||
{
|
||||
memcpy(OutSubResource.pData, StagingSubResource.pData, m_iOutputStructStride * m_iNumElement); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
|
||||
m_pContext->Unmap(ppBuffers[0], 0);
|
||||
}
|
||||
|
||||
m_pContext->Unmap(m_pStagingBuffer[0], 0);
|
||||
|
||||
m_pContext->Unmap(m_pOutputStagingBuffer, 0);
|
||||
}
|
||||
|
||||
Reset();
|
||||
|
||||
|
||||
return S_OK;
|
||||
return StagingSubResource;
|
||||
}
|
||||
|
||||
void CComputeShader::Bind_SRV(_uint iIndex)
|
||||
@@ -107,13 +101,21 @@ void CComputeShader::Bind_UAV(_uint iIndex)
|
||||
m_pContext->CSSetUnorderedAccessViews(iIndex, 1, &m_pOutputUAV, nullptr);
|
||||
}
|
||||
|
||||
void CComputeShader::Bind_OutPut_SRV(_uint iIndex)
|
||||
{
|
||||
m_pContext->CSSetShaderResources(iIndex, // 시작슬롯 번호
|
||||
1, // 버퍼 개수
|
||||
&m_pOutputSRV); // 버퍼 시작 주소
|
||||
}
|
||||
|
||||
void CComputeShader::Reset()
|
||||
{
|
||||
//다음 랜더링 패스에 연관되지 않도록 초기화
|
||||
ID3D11UnorderedAccessView* pResetUAV[1] = { nullptr };
|
||||
ID3D11ShaderResourceView* pResetSRV[1] = { nullptr };
|
||||
ID3D11ShaderResourceView* pResetSRV[2] = { nullptr, nullptr };
|
||||
|
||||
m_pContext->CSSetUnorderedAccessViews(0, 1, pResetUAV, nullptr);
|
||||
m_pContext->CSSetShaderResources(0, 1, pResetSRV);
|
||||
m_pContext->CSSetShaderResources(0, 2, pResetSRV);
|
||||
m_pContext->CSSetShader(nullptr, nullptr, 0);
|
||||
}
|
||||
|
||||
@@ -156,6 +158,7 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _
|
||||
m_pStagingBuffer.push_back(pStagingBuffer);
|
||||
}
|
||||
|
||||
//아웃풋 버퍼
|
||||
|
||||
D3D11_BUFFER_DESC Bufferdesc = {};
|
||||
Bufferdesc.ByteWidth = m_iOutputStructStride * iNumElement;
|
||||
@@ -170,7 +173,19 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iNumInputBuffer, _
|
||||
if(FAILED(m_pDevice->CreateBuffer(&Bufferdesc, nullptr, &m_pOutputBuffer)))
|
||||
return E_FAIL;
|
||||
|
||||
//아웃풋 스테이징 버퍼
|
||||
D3D11_BUFFER_DESC OutPutStagingBufferDesc = {};
|
||||
OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼
|
||||
OutPutStagingBufferDesc.ByteWidth = m_iOutputStructStride * iNumElement;
|
||||
OutPutStagingBufferDesc.StructureByteStride = m_iOutputStructStride;
|
||||
OutPutStagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE;
|
||||
|
||||
if (FAILED(m_pDevice->CreateBuffer(&OutPutStagingBufferDesc, nullptr, &m_pOutputStagingBuffer)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
@@ -188,7 +203,9 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf
|
||||
srvDesc.Format = DXGI_FORMAT_UNKNOWN;
|
||||
srvDesc.BufferEx.FirstElement = 0;
|
||||
srvDesc.BufferEx.NumElements = iNumElement;
|
||||
m_pDevice->CreateShaderResourceView(m_pInputBuffer[i], &srvDesc, &pSrv);
|
||||
|
||||
if (FAILED(m_pDevice->CreateShaderResourceView(m_pInputBuffer[i], &srvDesc, &pSrv)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pInputSRV.push_back(pSrv);
|
||||
|
||||
@@ -200,7 +217,20 @@ HRESULT CComputeShader::CreateResurceViews(_uint iNumElement, _uint iNumInputBuf
|
||||
uavDesc.Format = DXGI_FORMAT_UNKNOWN;
|
||||
uavDesc.Buffer.FirstElement = 0;
|
||||
uavDesc.Buffer.NumElements = iNumElement;
|
||||
m_pDevice->CreateUnorderedAccessView(m_pOutputBuffer, &uavDesc, &m_pOutputUAV);
|
||||
|
||||
if(FAILED(m_pDevice->CreateUnorderedAccessView(m_pOutputBuffer, &uavDesc, &m_pOutputUAV)))
|
||||
return E_FAIL;
|
||||
|
||||
//OUTPUT
|
||||
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {};
|
||||
srvDesc.Format = DXGI_FORMAT_UNKNOWN; // StructuredBuffer는 UNKNOWN
|
||||
srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER;
|
||||
srvDesc.Buffer.NumElements = iNumElement;
|
||||
srvDesc.BufferEx.FirstElement = 0;
|
||||
|
||||
if (FAILED(m_pDevice->CreateShaderResourceView(m_pOutputBuffer, &srvDesc, &m_pOutputSRV)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,10 @@ void CElementObject::Update(_float fTimeDelta)
|
||||
m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f);
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f) * m_pOwner->Get_WorldPostion());
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(
|
||||
m_fX + m_pOwner->Get_WorldPostion().m128_f32[0],
|
||||
-m_fY + m_pOwner->Get_WorldPostion().m128_f32[1],
|
||||
0.f, 1.f));
|
||||
|
||||
m_fCurrent_Posigion = XMVectorSet(m_fX, m_fY, 0.f, 1.f);
|
||||
}
|
||||
|
||||
@@ -450,6 +450,11 @@ HRESULT CGameInstance::Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilVi
|
||||
return m_pRenderTarget_Manager->Begin_MRT(strMRTTag, pDSV);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV)
|
||||
{
|
||||
return m_pRenderTarget_Manager->Begin_MRT_Include_BackBuffer(strMRTTag, pDSV);
|
||||
}
|
||||
|
||||
HRESULT CGameInstance::End_MRT()
|
||||
{
|
||||
return m_pRenderTarget_Manager->End_MRT();
|
||||
|
||||
@@ -176,7 +176,7 @@ HRESULT CInstance_Model::Initialize(void* pArg)
|
||||
};
|
||||
|
||||
m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext,
|
||||
L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, sizeof(VTX_INSTANCE_PARTICLE), CS_Strides);
|
||||
L"../Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl", "CS_MAIN", m_iNumInstance, 2, sizeof(CS_PARTICLE_OUT), CS_Strides);
|
||||
|
||||
if (m_pComputeShader == nullptr)
|
||||
return E_FAIL;
|
||||
@@ -211,8 +211,19 @@ void CInstance_Model::Drop(_float fTimeDelta)
|
||||
|
||||
};
|
||||
|
||||
m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer);
|
||||
D3D11_MAPPED_SUBRESOURCE OutSubResource = {};
|
||||
D3D11_MAPPED_SUBRESOURCE VBInstanceResource = {};
|
||||
|
||||
OutSubResource = m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer);
|
||||
|
||||
if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &VBInstanceResource)))
|
||||
{
|
||||
memcpy(VBInstanceResource.pData, OutSubResource.pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다.
|
||||
|
||||
m_pContext->Unmap(m_pVBInstance, 0);
|
||||
}
|
||||
|
||||
//TODO:: 벨류버퍼 갱신 해야함 , OutPut버퍼 두개만들어야할듯..
|
||||
}
|
||||
|
||||
|
||||
@@ -287,10 +298,13 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
|
||||
//¶óÀÌÇÁ ŸÀÓ ¼³Á¤
|
||||
pVertices[i].vLifeTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vLifeTime.x, m_InstanceDesc.vLifeTime.y));
|
||||
|
||||
|
||||
|
||||
pParticleValues[i].vAniTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vAniTime.x, m_InstanceDesc.vAniTime.y));
|
||||
pParticleValues[i].vMaskingUVMoveTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vMaskingUVMoveTime.x, m_InstanceDesc.vMaskingUVMoveTime.y));
|
||||
pParticleValues[i].vDiffuseUVMoveTime = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vDiffuseUVMoveTime.x, m_InstanceDesc.vDiffuseUVMoveTime.y));
|
||||
pParticleValues[i].fSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vSpeed.x, m_InstanceDesc.vSpeed.y);
|
||||
pParticleValues[i].fRotaionSpeed = m_pGameInstance->Random_Float(m_InstanceDesc.vRotationSpeed.x, m_InstanceDesc.vRotationSpeed.y);
|
||||
pParticleValues[i].vAniIndex = _float2(0.f, m_InstanceDesc.vAniIndex.y);
|
||||
|
||||
memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4));
|
||||
memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4));
|
||||
@@ -307,6 +321,17 @@ void CInstance_Model::Instane_Buffer_ReStruct()
|
||||
|
||||
}
|
||||
|
||||
HRESULT CInstance_Model::Bind_CS_Output(_uint Index)
|
||||
{
|
||||
if (m_pComputeShader == nullptr)
|
||||
return E_FAIL;
|
||||
|
||||
m_pComputeShader->Bind_OutPut_SRV(Index);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
|
||||
CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
@@ -409,6 +434,25 @@ void CInstance_Model::Describe_Entity()
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
if (ImGui::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime)))
|
||||
{
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
if (ImGui::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime)))
|
||||
{
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
if (ImGui::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime)))
|
||||
{
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
if (ImGui::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex)))
|
||||
{
|
||||
Instane_Buffer_ReStruct();
|
||||
}
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char
|
||||
|
||||
if (!file.is_open())
|
||||
{
|
||||
MSG_BOX("Failed to Open Materail File");
|
||||
//MSG_BOX("Failed to Open Materail File");
|
||||
//return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -388,8 +388,9 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
|
||||
if (!file.is_open())
|
||||
{
|
||||
MSG_BOX("Failed to Open Mesh File");
|
||||
return E_FAIL;
|
||||
//MSG_BOX("Failed to Open Mesh File");
|
||||
/* LOD */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
string strText = {};
|
||||
|
||||
@@ -64,28 +64,11 @@ HRESULT CPanelObject::Ready_Components(void* pArg)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CPanelObject::Ready_Panel(void* pArg)
|
||||
HRESULT CPanelObject::Ready_Element(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPanelObject::MoveX(_float fX)
|
||||
{
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(
|
||||
fX - m_fWinSizeX * 0.5f,
|
||||
-m_fY + m_fWinSizeY * 0.5f,
|
||||
0.f, 1.f));
|
||||
}
|
||||
|
||||
void CPanelObject::MoveY(_float fY)
|
||||
{
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(
|
||||
m_fX - m_fWinSizeX * 0.5f,
|
||||
-fY + m_fWinSizeY * 0.5f,
|
||||
0.f, 1.f));
|
||||
}
|
||||
|
||||
void CPanelObject::Visible(_bool bVisible)
|
||||
{
|
||||
if (m_Elements.empty())
|
||||
@@ -102,8 +85,14 @@ CGameObject* CPanelObject::Get_Element(const wstring& Name)
|
||||
return Find_Element(Name);
|
||||
}
|
||||
|
||||
void CPanelObject::Move_Panel(_float fX, _float fY)
|
||||
_int CPanelObject::Element_Count()
|
||||
{
|
||||
return m_iElements_Count;
|
||||
}
|
||||
|
||||
const vector<wstring> CPanelObject::Element_Name()
|
||||
{
|
||||
return m_ElementName;
|
||||
}
|
||||
|
||||
void CPanelObject::Add_Element(wstring Name, CGameObject* pPanel)
|
||||
@@ -119,7 +108,9 @@ void CPanelObject::Add_Element(wstring Name, CGameObject* pPanel)
|
||||
}
|
||||
|
||||
m_Elements.push_back(pPanel);
|
||||
m_ElementName.push_back(Name);
|
||||
m_Elements_map.emplace(Name, pPanel);
|
||||
m_iElements_Count++;
|
||||
}
|
||||
|
||||
CGameObject* CPanelObject::Find_Element(const wstring& Name)
|
||||
|
||||
@@ -49,7 +49,8 @@ void CPicking::Update()
|
||||
m_pGameInstance->Copy_RenderTarget(TEXT("Target_Depth"), m_pTexture2D);
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE SubResource{};
|
||||
m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ_WRITE, 0, &SubResource);
|
||||
if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_READ_WRITE, 0, &SubResource)))
|
||||
return;
|
||||
|
||||
memcpy(m_pPixels, SubResource.pData, sizeof(_float4) * m_iNumPixels);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ HRESULT CRenderTarget_Manager::Add_RenderTarget(const _wstring& strRenderTargetK
|
||||
|
||||
m_RenderTargets.emplace(strRenderTargetKey, pRenderTarget);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -62,6 +63,7 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey
|
||||
ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
|
||||
|
||||
m_pContext->OMSetRenderTargets(0, nullptr, nullptr);
|
||||
|
||||
if (nullptr != pDSV) {
|
||||
m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0);
|
||||
}
|
||||
@@ -79,6 +81,39 @@ HRESULT CRenderTarget_Manager::Begin_MRT(const _wstring& strMultiRenderTargetKey
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CRenderTarget_Manager::Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV)
|
||||
{
|
||||
m_pContext->OMGetRenderTargets(1, &m_pBackBufferRTV, &m_pOriginalDSV);
|
||||
|
||||
list<CRenderTarget*>* pMRTList = Find_MRT(strMRTTag);
|
||||
|
||||
if (nullptr == pMRTList)
|
||||
return E_FAIL;
|
||||
|
||||
_uint iNumRenderTargets = { 0 };
|
||||
ID3D11RenderTargetView* pRenderTargetViews[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = {};
|
||||
|
||||
m_pContext->OMSetRenderTargets(0, nullptr, nullptr);
|
||||
|
||||
if (nullptr != pDSV) {
|
||||
m_pContext->ClearDepthStencilView(pDSV, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.f, 0);
|
||||
}
|
||||
|
||||
pRenderTargetViews[iNumRenderTargets++] = m_pBackBufferRTV;
|
||||
|
||||
for (auto& pRenderTarget : *pMRTList)
|
||||
{
|
||||
pRenderTarget->Clear();
|
||||
pRenderTargetViews[iNumRenderTargets++] = pRenderTarget->Get_RTV();
|
||||
}
|
||||
if (0 == iNumRenderTargets) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pContext->OMSetRenderTargets(iNumRenderTargets, pRenderTargetViews, (nullptr == pDSV) ? m_pOriginalDSV : pDSV);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D)
|
||||
{
|
||||
CRenderTarget* pRenderTarget = Find_RenderTarget(strTargetTag);
|
||||
@@ -91,6 +126,7 @@ HRESULT CRenderTarget_Manager::Copy_RenderTarget(const _wstring& strTargetTag, I
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CRenderTarget_Manager::End_MRT()
|
||||
{
|
||||
ID3D11RenderTargetView* pRenderTargets[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT] = { m_pBackBufferRTV };
|
||||
@@ -137,6 +173,7 @@ HRESULT CRenderTarget_Manager::Render_RenderTarget_Debug(const _wstring& strMRTT
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
CRenderTarget* CRenderTarget_Manager::Find_RenderTarget(const _wstring& strRenderTargetKey)
|
||||
|
||||
@@ -110,6 +110,7 @@ void CRenderer::Render()
|
||||
Render_LightAcc();
|
||||
Render_Blur();
|
||||
Render_Combined();
|
||||
Render_Effect();
|
||||
Render_NonLight();
|
||||
Render_Blend();
|
||||
Render_UI();
|
||||
@@ -300,8 +301,6 @@ void CRenderer::Render_Combined()
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Blur_X"), m_pShader, "g_BlurXTexture"))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::COMBINED));
|
||||
@@ -310,6 +309,28 @@ void CRenderer::Render_Combined()
|
||||
m_pVIBuffer->Render();
|
||||
}
|
||||
|
||||
void CRenderer::Render_Effect()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Begin_MRT_Include_BackBuffer(TEXT("MRT_Color")))) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)])
|
||||
{
|
||||
if (nullptr != pRenderObject)
|
||||
pRenderObject->Render();
|
||||
|
||||
SAFE_RELEASE(pRenderObject);
|
||||
}
|
||||
|
||||
m_RenderObjects[ENUM_CLASS(RENDER::EFFECT)].clear();
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->End_MRT())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void CRenderer::Render_NonLight()
|
||||
{
|
||||
for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::NONLIGHT)])
|
||||
@@ -417,18 +438,15 @@ void CRenderer::Render_LastColor()
|
||||
{
|
||||
// Bind_Resorces
|
||||
|
||||
m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix);
|
||||
m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix);
|
||||
m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix);
|
||||
m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV));
|
||||
m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV));
|
||||
m_pLastColorShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix);
|
||||
m_pLastColorShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix);
|
||||
m_pLastColorShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix);
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Color"), m_pShader, "g_ColorTexture"))) {
|
||||
if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Color"), m_pLastColorShader, "g_ColorTexture"))) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_pShader->Begin(ENUM_CLASS(0));
|
||||
m_pLastColorShader->Begin(0);
|
||||
|
||||
m_pVIBuffer->Bind_Resources();
|
||||
m_pVIBuffer->Render();
|
||||
@@ -514,6 +532,9 @@ void CRenderer::Render_Debug()
|
||||
if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Blur_X"), m_pShader, m_pVIBuffer))){
|
||||
return;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Render_RenderTarget_Debug(TEXT("MRT_Color"), m_pShader, m_pVIBuffer))) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -632,6 +653,11 @@ HRESULT CRenderer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* MRT_Color */
|
||||
if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Color"), TEXT("Target_Color")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
}
|
||||
m_pShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, TEXT("FX_DEFERRED"), nullptr, nullptr);
|
||||
if (nullptr == m_pShader) {
|
||||
@@ -657,37 +683,37 @@ HRESULT CRenderer::Initialize()
|
||||
XMStoreFloat4x4(&m_ProjMatrix, XMMatrixOrthographicLH(Viewport.Width, Viewport.Height, 0.f, 1.f));
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Diffuse"), 75.f, 75.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Normal"), 75.f, 225.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shade"), 225.f, 75.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) {
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Diffuse"), 75.f, 75.f, 150.0f, 150.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Normal"), 75.f, 225.f, 150.0f, 150.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shade"), 225.f, 75.f, 150.0f, 150.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Specular"), 225.f, 225.f, 150.0f, 150.0f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"), 375.f, 225.f, 450.f, 450.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Color"), 375.f, 75.f, 150.0f, 150.0f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Shadow"), Viewport.Width - 150.0f, 150.0f, 300.f, 300.f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_PreShadow"), Viewport.Width - 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur"), 150.0f, Viewport.Height - 150.0f, 300.f, 300.f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), Viewport.Width * 0.75f, Viewport.Height * 0.75f, Viewport.Width * 0.5f, Viewport.Height * 0.5f))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
//if (FAILED(m_pGameInstance->Ready_RenderTarget_Debug(TEXT("Target_Blur_X"), Viewport.Width * 0.75f, Viewport.Height * 0.75f, Viewport.Width * 0.5f, Viewport.Height * 0.5f))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -27,13 +27,17 @@ class ENGINE_DLL CCanvasObject abstract : public CUIObject
|
||||
public:
|
||||
virtual void Visible(_bool bVisible) override;
|
||||
virtual class CGameObject* Get_Panel(const wstring& Name);
|
||||
virtual _int Panels_Count();
|
||||
virtual const vector<wstring> Panel_Name();
|
||||
|
||||
protected:
|
||||
virtual void Add_Panel(wstring Name, class CGameObject* pPanel);
|
||||
|
||||
protected:
|
||||
vector<class CGameObject*> m_Panels; // 캔버스가 패널들을 관리 하기 위해서 필요함
|
||||
map<wstring ,class CGameObject*> m_Panels_map; // 캔버스에서 내가 원하는 패널을 찾기 위해서
|
||||
vector<class CGameObject*> m_Panels; // 캔버스가 패널들을 관리 하기 위해서 필요함
|
||||
vector<wstring> m_PanelNames; // 패널들의 이름을 전해주기 위해서
|
||||
map<wstring ,class CGameObject*> m_Panels_map; // 캔버스에서 내가 원하는 패널을 찾기 위해서
|
||||
_int m_iPanel_Count{}; // 전체 패널의 갯수
|
||||
|
||||
private:
|
||||
virtual class CGameObject* Find_Panel(const wstring& Name);
|
||||
|
||||
@@ -15,8 +15,8 @@ class ENGINE_DLL CComputeShader final : public CBase
|
||||
public:
|
||||
HRESULT Initialize(const _tchar* pShaderFilePath, const _char* pStartFunctionName, _uint iNumElement, _uint iNumInputBuffer, _uint iOutputStructStride, _uint iInputStructStride[]);
|
||||
public:
|
||||
HRESULT Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr);
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE Dispatch(_uint iSRVIndex, _uint iUAVIndex, _float3 vGroupCount, ID3D11Buffer** ppBuffers, ID3D11Buffer* pConstantBuffer = nullptr);
|
||||
void Bind_OutPut_SRV(_uint iIndex);
|
||||
private:
|
||||
void Bind_SRV(_uint iIndex);
|
||||
void Bind_UAV(_uint iIndex);
|
||||
@@ -39,8 +39,11 @@ class ENGINE_DLL CComputeShader final : public CBase
|
||||
ID3D11Buffer* m_pOutputBuffer = nullptr;
|
||||
|
||||
vector<ID3D11Buffer*> m_pStagingBuffer = {};
|
||||
ID3D11Buffer* m_pOutputStagingBuffer = {};
|
||||
ID3D11ComputeShader* m_pComputeShader = nullptr;
|
||||
|
||||
ID3D11ShaderResourceView* m_pOutputSRV = { nullptr };
|
||||
|
||||
private:
|
||||
_uint m_iNumElement = 0; // 인수 개수
|
||||
_uint m_iNumInputBuffer = 0; // 인풋 버퍼의 개수
|
||||
|
||||
@@ -5,7 +5,7 @@ NS_BEGIN(Engine)
|
||||
enum class STATE { RIGHT, UP, LOOK, POSITION, END };
|
||||
enum class LIGHT { DIRECTIONAL, POINT, SPOT, END };
|
||||
enum class COLLIDER { AABB, OBB, SPHERE, END };
|
||||
enum class RENDER { PRIORITY, SHADOW, NONBLEND, BLUR, NONLIGHT, BLEND, UI, END };
|
||||
enum class RENDER { PRIORITY, SHADOW, NONBLEND, BLUR, NONLIGHT, EFFECT ,BLEND, UI, END };
|
||||
enum class RAY { LOCAL, WORLD, END };
|
||||
enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END };
|
||||
|
||||
|
||||
@@ -146,6 +146,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor);
|
||||
HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey);
|
||||
HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr);
|
||||
HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV = nullptr);
|
||||
HRESULT End_MRT();
|
||||
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
|
||||
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
|
||||
|
||||
@@ -21,31 +21,56 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
_float3 vCenter = {}; // ¼¾ÅÍ À§Ä¡
|
||||
_float3 vRange = {}; // À§Ä¡ ¹üÀ§
|
||||
|
||||
_float2 vMaskingUVMoveTime = {};
|
||||
_float2 vDiffuseUVMoveTime = {};
|
||||
_float2 vAniTime = {};
|
||||
_float2 vAniIndex = {};
|
||||
|
||||
}INSTANCE_DESC;
|
||||
|
||||
typedef struct tagCSParticleDesc
|
||||
{
|
||||
_float fTimeDelta;
|
||||
_float fPadding;
|
||||
_float fPadding2;
|
||||
_float fPadding3;
|
||||
_float fTimeDelta = {};
|
||||
_float fPadding = {};
|
||||
_float fPadding2 = {};
|
||||
_float fPadding3 = {};
|
||||
|
||||
}CS_PARTICLE_DESC;
|
||||
|
||||
typedef struct tagCSParticleValueDesc
|
||||
{
|
||||
_float fSpeed;
|
||||
_float fRotaionSpeed;
|
||||
_float fSpeed = {};
|
||||
_float fRotaionSpeed = {};
|
||||
|
||||
_float4 vOriginRight;
|
||||
_float4 vOriginUp;
|
||||
_float4 vOriginLook;
|
||||
_float4 vOriginTranslation;
|
||||
_float4 vOriginRight = {};
|
||||
_float4 vOriginUp = {};
|
||||
_float4 vOriginLook = {};
|
||||
_float4 vOriginTranslation = {};
|
||||
|
||||
_float2 fPadding;
|
||||
_float2 vMaskingUVMoveTime = {};
|
||||
_float2 vDiffuseUVMoveTime = {};
|
||||
_float2 vAniTime = {};
|
||||
|
||||
_float2 vAniIndex = {};
|
||||
|
||||
}CS_PARTICLE_VALUE_DESC;
|
||||
|
||||
|
||||
struct ParticleOut
|
||||
{
|
||||
_float4 vRight = {};
|
||||
_float4 vUp = {};
|
||||
_float4 vLook = {};
|
||||
_float4 vTranslation = {};
|
||||
_float2 vLifeTime = {};
|
||||
|
||||
_float2 vMaskingUVMoveTime = {};
|
||||
_float2 vDiffuseUVMoveTime = {};
|
||||
_float2 vAniTime = {};
|
||||
|
||||
_float2 vAniIndex = {};
|
||||
|
||||
}CS_PARTICLE_OUT;
|
||||
public:
|
||||
CInstance_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CInstance_Model(const CInstance_Model& rhs);
|
||||
@@ -63,6 +88,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent
|
||||
HRESULT Render(_uint iMeshIndx);
|
||||
void Instane_Buffer_ReStruct();
|
||||
_uint Get_NumMeshes() const { return m_iNumMeshes; }
|
||||
HRESULT Bind_CS_Output(_uint Index);
|
||||
private:
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex);
|
||||
|
||||
@@ -22,21 +22,22 @@ class ENGINE_DLL CPanelObject abstract : public CUIObject
|
||||
virtual HRESULT Initialize_Prototype();
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Ready_Panel(void* pArg);
|
||||
virtual HRESULT Ready_Element(void* pArg);
|
||||
|
||||
public:
|
||||
virtual void MoveX(_float fX) override;
|
||||
virtual void MoveY(_float fY) override;
|
||||
virtual void Visible(_bool bVisible) override;
|
||||
virtual class CGameObject* Get_Element(const wstring& Name);
|
||||
virtual void Move_Panel(_float fX, _float fY);
|
||||
virtual _int Element_Count();
|
||||
virtual const vector<wstring> Element_Name();
|
||||
|
||||
protected:
|
||||
virtual void Add_Element(wstring Name, class CGameObject* pPanel);
|
||||
|
||||
protected:
|
||||
vector<class CGameObject*> m_Elements;
|
||||
map<wstring, class CGameObject*> m_Elements_map; // 캔버스에서 내가 원하는 패널을 찾기 위해서
|
||||
vector<class CGameObject*> m_Elements; // 패널이 엘리먼츠를 관리하기 위해 만듬
|
||||
vector<wstring> m_ElementName; // 엘리멘트들의 이름을 전해주기 위해서
|
||||
map<wstring, class CGameObject*> m_Elements_map; // 캔버스에서 내가 원하는 패널을 찾기 위해서
|
||||
_int m_iElements_Count{}; // 전체 엘리멘트의 갯수
|
||||
|
||||
private:
|
||||
virtual class CGameObject* Find_Element(const wstring& Name);
|
||||
|
||||
@@ -13,6 +13,7 @@ class CRenderTarget_Manager final : public CBase
|
||||
HRESULT Add_RenderTarget(const _wstring& strRenderTargetKey, _uint iSizeX, _uint iSizeY, DXGI_FORMAT ePixelFormat, const _float4& vClearColor);
|
||||
HRESULT Add_MRT(const _wstring& strMultiRenderTargetKey, const _wstring& strRenderTargetKey);
|
||||
HRESULT Begin_MRT(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV);
|
||||
HRESULT Begin_MRT_Include_BackBuffer(const _wstring& strMRTTag, ID3D11DepthStencilView* pDSV);
|
||||
HRESULT End_MRT();
|
||||
HRESULT Bind_RenderTarget(const _wstring& strTargetTag, class CShader* pShader, const _char* pConstantName);
|
||||
HRESULT Copy_RenderTarget(const _wstring& strTargetTag, ID3D11Texture2D* pTexture2D);
|
||||
|
||||
@@ -58,6 +58,7 @@ class CRenderer final : public CBase
|
||||
void Render_LightAcc();
|
||||
void Render_Blur();
|
||||
void Render_Combined();
|
||||
void Render_Effect();
|
||||
void Render_NonLight();
|
||||
void Render_Blend();
|
||||
void Render_UI();
|
||||
|
||||
Reference in New Issue
Block a user