[add] basic_Level
This commit is contained in:
@@ -336,6 +336,107 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_MROCOMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
|
||||
vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vDiffuse.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vector vShade = g_ShadeTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vSpecular = g_SpecularTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Out.vBackBuffer = vDiffuse * vShade + vSpecular;
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
|
||||
|
||||
vector vPosition, vPreShadowPosition;
|
||||
|
||||
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
|
||||
vPosition = vPosition * fViewZ;
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
vPosition = mul(vPosition, g_LightViewMatrix);
|
||||
vPosition = mul(vPosition, g_LightProjMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightViewMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightProjMatrix);
|
||||
|
||||
/* (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 * (/w) */
|
||||
float2 vTexcoord, vPreShadowTexcoord;
|
||||
vTexcoord.x = (vPosition.x / vPosition.w) * 0.5f + 0.5f;
|
||||
vTexcoord.y = (vPosition.y / vPosition.w) * -0.5f + 0.5f;
|
||||
vPreShadowTexcoord.x = (vPreShadowPosition.x / vPreShadowPosition.w) * 0.5f + 0.5f;
|
||||
vPreShadowTexcoord.y = (vPreShadowPosition.y / vPreShadowPosition.w) * -0.5f + 0.5f;
|
||||
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic = ShadowVisibility_hwPCF(g_ShadowTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static));
|
||||
//float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x;
|
||||
//float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x;
|
||||
//bool IsShadow = { false };
|
||||
//if (vPosition.z - 0.0005f > fShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (vPreShadowPosition.z - 0.0005f > fPreShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (true == IsShadow)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
float4 vColor = 0.f;
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_OUT_BLUR_X
|
||||
{
|
||||
float4 vBlurX : SV_TARGET0;
|
||||
@@ -444,4 +545,13 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
pass MROCombinedPass
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_MROCOMBINED();
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -336,6 +336,107 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_MROCOMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
|
||||
vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vDiffuse.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vector vShade = g_ShadeTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vSpecular = g_SpecularTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Out.vBackBuffer = vDiffuse * vShade + vSpecular;
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
|
||||
|
||||
vector vPosition, vPreShadowPosition;
|
||||
|
||||
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
|
||||
vPosition = vPosition * fViewZ;
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
vPosition = mul(vPosition, g_LightViewMatrix);
|
||||
vPosition = mul(vPosition, g_LightProjMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightViewMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightProjMatrix);
|
||||
|
||||
/* (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 * (/w) */
|
||||
float2 vTexcoord, vPreShadowTexcoord;
|
||||
vTexcoord.x = (vPosition.x / vPosition.w) * 0.5f + 0.5f;
|
||||
vTexcoord.y = (vPosition.y / vPosition.w) * -0.5f + 0.5f;
|
||||
vPreShadowTexcoord.x = (vPreShadowPosition.x / vPreShadowPosition.w) * 0.5f + 0.5f;
|
||||
vPreShadowTexcoord.y = (vPreShadowPosition.y / vPreShadowPosition.w) * -0.5f + 0.5f;
|
||||
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic = ShadowVisibility_hwPCF(g_ShadowTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static));
|
||||
//float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x;
|
||||
//float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x;
|
||||
//bool IsShadow = { false };
|
||||
//if (vPosition.z - 0.0005f > fShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (vPreShadowPosition.z - 0.0005f > fPreShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (true == IsShadow)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
float4 vColor = 0.f;
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_OUT_BLUR_X
|
||||
{
|
||||
float4 vBlurX : SV_TARGET0;
|
||||
@@ -444,4 +545,13 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
pass MROCombinedPass
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_MROCOMBINED();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ Texture2D g_ClippingTexture;
|
||||
Texture2D g_DisolveTexture;
|
||||
Texture2D g_NormalTexture;
|
||||
Texture2D g_GlowTexture;
|
||||
Texture2D g_MROTexture;
|
||||
|
||||
struct VS_IN
|
||||
{
|
||||
@@ -181,6 +182,30 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
|
||||
return Out;
|
||||
}
|
||||
PS_OUT PS_PROP(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
if (vMtrlDiffuse.a < 0.2f)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord);
|
||||
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
|
||||
|
||||
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
|
||||
|
||||
float fRoughness = g_MROTexture.Sample(DefaultSampler, In.vTexcoord).g;
|
||||
|
||||
|
||||
Out.vDiffuse = vMtrlDiffuse;
|
||||
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
|
||||
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, fRoughness, 1.f);
|
||||
|
||||
return Out;
|
||||
}
|
||||
PS_OUT PS_MAIN_SELECT(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
@@ -479,4 +504,22 @@ technique11 MeshTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_GLASS();
|
||||
}
|
||||
pass PropPass // 13
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_None, 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_PROP();
|
||||
}
|
||||
pass NoMROPropPass // 14
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,6 +172,7 @@
|
||||
<ClInclude Include="..\Public\CallBack_Playable_HitReport.h" />
|
||||
<ClInclude Include="..\Public\DummyObject.h" />
|
||||
<ClInclude Include="..\public\DummySkyBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_Globe.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXDoorFrame.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -204,6 +205,7 @@
|
||||
<ClInclude Include="..\Public\EditEffect.h" />
|
||||
<ClInclude Include="..\Public\Information.h" />
|
||||
<ClInclude Include="..\public\Land.h" />
|
||||
<ClInclude Include="..\Public\Level_BloomViewer.h" />
|
||||
<ClInclude Include="..\public\Level_MapViewer.h" />
|
||||
<ClInclude Include="..\Public\LoadingWidget.h" />
|
||||
<ClInclude Include="..\public\MapContainer.h" />
|
||||
@@ -276,6 +278,7 @@
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp" />
|
||||
<ClCompile Include="..\Private\DummyObject.cpp" />
|
||||
<ClCompile Include="..\private\DummySkyBox.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Globe.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_PhysXDoorFrame.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
@@ -308,6 +311,7 @@
|
||||
<ClCompile Include="..\Private\EditEffect.cpp" />
|
||||
<ClCompile Include="..\Private\Information.cpp" />
|
||||
<ClCompile Include="..\private\Land.cpp" />
|
||||
<ClCompile Include="..\Private\Level_BloomViewer.cpp" />
|
||||
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
||||
<ClCompile Include="..\Private\LoadingWidget.cpp" />
|
||||
<ClCompile Include="..\private\MapContainer.cpp" />
|
||||
|
||||
@@ -280,6 +280,12 @@
|
||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable">
|
||||
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="01.Level\65.BloomViewer">
|
||||
<UniqueIdentifier>{19c5f600-e566-4903-ab74-448904dcbc99}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Dummys\DummyGlobe">
|
||||
<UniqueIdentifier>{04d044a9-3cab-4425-9adf-8eea436e71d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -549,6 +555,12 @@
|
||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_BloomViewer.h">
|
||||
<Filter>01.Level\65.BloomViewer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_Globe.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -814,6 +826,12 @@
|
||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Level_BloomViewer.cpp">
|
||||
<Filter>01.Level\65.BloomViewer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Dummy_Globe.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
#include "pch.h"
|
||||
#include "Dummy_Globe.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
|
||||
|
||||
CDummy_Globe::CDummy_Globe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CDummy_Globe::CDummy_Globe(const CDummy_Globe& rhs)
|
||||
: CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDummy_Globe::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Globe::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDummy_Globe::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CDummy_Globe::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CDummy_Globe::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CDummy_Globe::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_MROTexture", aiTextureType_SHININESS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (true == m_bMRO) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::PROP)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::NOMROPROP)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Globe::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Desc_Globe"),
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDummy_Globe::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CDummy_Globe* CDummy_Globe::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDummy_Globe* pInstance = new CDummy_Globe(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDummy_Globe");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDummy_Globe::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDummy_Globe* pInstance = new CDummy_Globe(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDummy_Globe");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDummy_Globe::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pModelCom);
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
}
|
||||
|
||||
void CDummy_Globe::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
#include "pch.h"
|
||||
#include "Level_BloomViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Dummy_Cube.h"
|
||||
#include "Dummy_Globe.h"
|
||||
#include "MainLight.h"
|
||||
#include "Dummy_Plane.h"
|
||||
|
||||
CLevel_BloomViewer::CLevel_BloomViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CLevel_BloomViewer::Initialize()
|
||||
{
|
||||
if (FAILED(Ready_Layer_Light())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Effect(TEXT("Layer_Effect"))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Globe>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))){
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Plane>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))){
|
||||
// return E_FAIL;
|
||||
//}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CLevel_BloomViewer::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CLevel_BloomViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT CLevel_BloomViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 5.f;
|
||||
CameraDesc.pCameraKey = TEXT("Debug_Camera");
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_BloomViewer::Ready_Layer_Light()
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMainLight>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_BloomViewer::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT CLevel_BloomViewer::Ready_Layer_Effect(const _wstring& strLayerTag)
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
CLevel_BloomViewer* CLevel_BloomViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
{
|
||||
CLevel_BloomViewer* pInstance = new CLevel_BloomViewer(pDevice, pContext, eLevelID);
|
||||
|
||||
if (FAILED(pInstance->Initialize()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLevel_BloomViewer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CLevel_BloomViewer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "Loader.h"
|
||||
#include "GameInstance.h"
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "Level_ObjectViewer.h"
|
||||
#include "Level_EffectViewer.h"
|
||||
#include "Level_MapViewer.h"
|
||||
#include "Level_BloomViewer.h"
|
||||
#include "Level_PhysXLab.h"
|
||||
|
||||
|
||||
@@ -62,9 +63,9 @@ void CLevel_Loading::Update(_float fTimeDelta)
|
||||
case LEVEL::PHYSX:
|
||||
pNewLevel = CLevel_PhysXLab::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
break;
|
||||
//case LEVEL::PARTICLE:
|
||||
// pNewLevel = CLevel_ParticleViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
// break;
|
||||
case LEVEL::BLOOM:
|
||||
pNewLevel = CLevel_BloomViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
break;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Change_Level(pNewLevel)))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "pch.h"
|
||||
#include "Level_Logo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
@@ -42,10 +42,10 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::PHYSX))))
|
||||
return;
|
||||
}
|
||||
//else if (GUI::Button("Particle Editor", { 100, 100 })) {
|
||||
// if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::PARTICLE))))
|
||||
// return;
|
||||
//}
|
||||
else if (GUI::SameLine(), GUI::Button("Bloom Editor", { 100, 100 })) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::BLOOM))))
|
||||
return;
|
||||
}
|
||||
else if (GUI::Button("UI Editor", { 100, 100 })) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::UI))))
|
||||
return;
|
||||
@@ -55,7 +55,7 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
|
||||
HRESULT CLevel_Logo::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
|
||||
SetWindowText(g_hWnd, TEXT("로고레벨입니다"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "DummySkyBox.h"
|
||||
#include "DummyObject.h"
|
||||
#include "Player.h"
|
||||
#include <filesystem>
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -91,6 +90,12 @@
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region BLOOM_HEADER
|
||||
|
||||
#include "Dummy_Globe.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: m_pDevice{ pDevice }
|
||||
, m_pContext{ pContext }
|
||||
@@ -120,8 +125,9 @@ HRESULT CLoader::Initialize(LEVEL eNextLevelID)
|
||||
InitializeCriticalSection(&m_CriticalSection);
|
||||
|
||||
m_hThread = (HANDLE)_beginthreadex(nullptr, 0, LoadingMain, this, 0, nullptr);
|
||||
if (0 == m_hThread)
|
||||
if (0 == m_hThread){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -160,9 +166,9 @@ HRESULT CLoader::Loading()
|
||||
case LEVEL::PHYSX:
|
||||
hr = Loading_For_PhysXLevel();
|
||||
break;
|
||||
//case LEVEL::PARTICLE:
|
||||
// hr = Loading_For_Particle();
|
||||
// break;
|
||||
case LEVEL::BLOOM:
|
||||
hr = Loading_For_Bloom();
|
||||
break;
|
||||
default:
|
||||
assert(false);
|
||||
break;
|
||||
@@ -869,6 +875,43 @@ HRESULT CLoader::Loading_For_PhysXLevel()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Loading_For_Bloom()
|
||||
{
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Desc_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(10.f, 10.f, 10.f) * XMMatrixIdentity())))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Model_DummyPlane"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx", XMMatrixTranslation(0.f, -10.f, 0.f) * XMMatrixIdentity())))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Desc_Globe"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/DragonGlobe/DragonGlobe.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Globe>(g_iStaticLevel, CDummy_Globe::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Plane>(g_iStaticLevel, CDummy_Plane::Create(m_pDevice, m_pContext)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("Loading Success!");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent)
|
||||
{
|
||||
for (const auto& file : filesystem::directory_iterator(pDirectoryPath))
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CDummy_Globe final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CDummy_Globe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDummy_Globe(const CDummy_Globe& rhs);
|
||||
virtual ~CDummy_Globe() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
_bool m_bMRO = { false };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
public:
|
||||
static CDummy_Globe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -13,13 +13,13 @@ namespace Editor
|
||||
const unsigned int g_iWinSizeX = 1920;
|
||||
const unsigned int g_iWinSizeY = 1080;
|
||||
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, END };
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP, UI, EFFECT, PHYSX, BLOOM, END };
|
||||
enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END };
|
||||
enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT };
|
||||
|
||||
enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END };
|
||||
enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END };
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, END };
|
||||
enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, PROP, NOMROPROP, END };
|
||||
enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "Level.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CLevel_BloomViewer final : public CLevel
|
||||
{
|
||||
private:
|
||||
CLevel_BloomViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual ~CLevel_BloomViewer() = default;
|
||||
|
||||
public:
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
/* 이 레벨에서 쓰기위한 객체들을 생성한다. */
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Ready_Layer_Camera(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Light();
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Effect(const _wstring& strLayerTag);
|
||||
|
||||
public:
|
||||
static CLevel_BloomViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -48,6 +48,7 @@ class CLoader final : public CBase
|
||||
HRESULT Loading_For_UI();
|
||||
HRESULT Loading_For_Effect();
|
||||
HRESULT Loading_For_PhysXLevel();
|
||||
HRESULT Loading_For_Bloom();
|
||||
|
||||
private:
|
||||
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
|
||||
|
||||
@@ -336,6 +336,107 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT_BACKBUFFER PS_MAIN_MROCOMBINED(PS_IN In)
|
||||
{
|
||||
PS_OUT_BACKBUFFER Out;
|
||||
|
||||
vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
if (0.f == vDiffuse.a)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
vector vShade = g_ShadeTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
vector vSpecular = g_SpecularTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
Out.vBackBuffer = vDiffuse * vShade + vSpecular;
|
||||
|
||||
vector vDepthDesc = g_DepthTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
|
||||
|
||||
float fViewZ = vDepthDesc.y * g_fFar;
|
||||
|
||||
|
||||
vector vPosition, vPreShadowPosition;
|
||||
|
||||
/* (로컬위치 * 월드 * 뷰 * 투영 / w) -> (로컬위치 * 월드) */
|
||||
vPosition.x = In.vTexcoord.x * 2.f - 1.f;
|
||||
vPosition.y = In.vTexcoord.y * -2.f + 1.f;
|
||||
vPosition.z = vDepthDesc.x;
|
||||
vPosition.w = 1.f;
|
||||
|
||||
vPosition = vPosition * fViewZ;
|
||||
|
||||
vPosition = mul(vPosition, g_invmatProj);
|
||||
vPosition = mul(vPosition, g_invMatView);
|
||||
vPreShadowPosition = vPosition;
|
||||
/* (로컬위치 * 월드) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) */
|
||||
vPosition = mul(vPosition, g_LightViewMatrix);
|
||||
vPosition = mul(vPosition, g_LightProjMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightViewMatrix);
|
||||
vPreShadowPosition = mul(vPreShadowPosition, g_PreShadowLightProjMatrix);
|
||||
|
||||
/* (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 ) -> (로컬위치 * 월드 * 광원의 뷰 * 광원의 투영 * (/w) */
|
||||
float2 vTexcoord, vPreShadowTexcoord;
|
||||
vTexcoord.x = (vPosition.x / vPosition.w) * 0.5f + 0.5f;
|
||||
vTexcoord.y = (vPosition.y / vPosition.w) * -0.5f + 0.5f;
|
||||
vPreShadowTexcoord.x = (vPreShadowPosition.x / vPreShadowPosition.w) * 0.5f + 0.5f;
|
||||
vPreShadowTexcoord.y = (vPreShadowPosition.y / vPreShadowPosition.w) * -0.5f + 0.5f;
|
||||
|
||||
/* 광원의 NDC에서 샘플링 */
|
||||
float fVisibility_Dynamic = ShadowVisibility_hwPCF(g_ShadowTexture, vPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, float2(g_iMaxShadowWidth, g_iMaxShadowHeight), 0.0005f);
|
||||
|
||||
Out.vBackBuffer.rgb *= lerp(0.5f, 1.f, min(fVisibility_Dynamic, fVisibility_Static));
|
||||
//float fShadowDepth = g_ShadowTexture.Sample(DefaultSampler, vTexcoord).x;
|
||||
//float fPreShadowDepth = g_PreShadowTexture.Sample(DefaultSampler, vPreShadowTexcoord).x;
|
||||
//bool IsShadow = { false };
|
||||
//if (vPosition.z - 0.0005f > fShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (vPreShadowPosition.z - 0.0005f > fPreShadowDepth)
|
||||
//{
|
||||
// IsShadow = true;
|
||||
//}
|
||||
//if (true == IsShadow)
|
||||
//{
|
||||
// Out.vBackBuffer *= 0.5f;
|
||||
//}
|
||||
float4 vColor = 0.f;
|
||||
|
||||
//int iBlurWeight = g_BlurWeightTexture.Sample(ClampSampler, In.vTexcoord).r * 32.f;
|
||||
|
||||
//int iBlurMin;
|
||||
//int iBlurMax;
|
||||
|
||||
//if (iBlurWeight % 2 == 0)
|
||||
//{
|
||||
// iBlurMin = -1 * iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// iBlurMin = -iBlurWeight / 2;
|
||||
// iBlurMax = iBlurWeight / 2 + 1;
|
||||
//}
|
||||
|
||||
//[loop] // 변수로 루프돌리려면 반드시 필요함
|
||||
for (int i = -15; i < 16; ++i)
|
||||
{
|
||||
vTexcoord.x = In.vTexcoord.x;
|
||||
vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y;
|
||||
|
||||
vColor += g_fWeights[i + 15] * g_BlurXTexture.Sample(ClampSampler, vTexcoord);
|
||||
}
|
||||
|
||||
Out.vBackBuffer += vColor;
|
||||
|
||||
return Out;
|
||||
}
|
||||
|
||||
struct PS_OUT_BLUR_X
|
||||
{
|
||||
float4 vBlurX : SV_TARGET0;
|
||||
@@ -444,4 +545,13 @@ technique11 DefaultTechnique
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_SPOT();
|
||||
}
|
||||
pass MROCombinedPass
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_None, 0);
|
||||
SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_MAIN_MROCOMBINED();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "HRO"))
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "SROH"))
|
||||
else if (!strcmp(FileType.c_str(), "SROH"))
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "SROA"))
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
|
||||
Reference in New Issue
Block a user