[add] Light and Volumetric Setting
This commit is contained in:
@@ -42,10 +42,31 @@ CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pCo
|
|||||||
|
|
||||||
HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||||
{
|
{
|
||||||
|
// 낮, 밤 설정
|
||||||
|
#ifdef gimch
|
||||||
|
m_isDay = false;
|
||||||
|
#endif // gimch
|
||||||
|
#ifdef Bin
|
||||||
|
m_isDay = true;
|
||||||
|
#endif //
|
||||||
|
#ifdef 진우
|
||||||
|
isDay = true;
|
||||||
|
#endif //
|
||||||
|
#ifdef 기무리
|
||||||
|
isDay = true;
|
||||||
|
#endif //
|
||||||
|
#ifdef 인혁
|
||||||
|
isDay = true;
|
||||||
|
#endif //
|
||||||
|
|
||||||
if (FAILED(Ready_Lights())) {
|
if (FAILED(Ready_Lights())) {
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FAILED(Ready_Volumetric())) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
//플레이어 , 맵 보다 먼저 생성해야함 !
|
//플레이어 , 맵 보다 먼저 생성해야함 !
|
||||||
if (FAILED(Reday_Layer_EffectPool())) {
|
if (FAILED(Reday_Layer_EffectPool())) {
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
@@ -164,13 +185,54 @@ HRESULT CLevel_GamePlay::Render()
|
|||||||
|
|
||||||
HRESULT CLevel_GamePlay::Ready_Lights()
|
HRESULT CLevel_GamePlay::Ready_Lights()
|
||||||
{
|
{
|
||||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLight_Main>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) {
|
|
||||||
|
LIGHT_DESC Desc = {};
|
||||||
|
if (m_isDay)
|
||||||
|
{
|
||||||
|
Desc.vDiffuse = _float4(0.6529f, 0.6157f, 0.7843f, 1.0f);
|
||||||
|
Desc.vAmbient = _float4(0.6275f, 0.6275f, 0.6275f, 0.0314f);
|
||||||
|
Desc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.05f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Desc.vDiffuse = _float4(0.0471f, 0.0745f, 0.1294f, 0.2549f);
|
||||||
|
Desc.vAmbient = _float4(0.1686f, 0.1765f, 0.1373f, 0.0f);
|
||||||
|
Desc.vSpecular = _float4(0.0f, 0.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLight_Main>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT, &Desc))) {
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HRESULT CLevel_GamePlay::Ready_Volumetric()
|
||||||
|
{
|
||||||
|
// Volumetric 설정
|
||||||
|
if(m_isDay)
|
||||||
|
{
|
||||||
|
m_pGameInstance->Setting_Volumetirc(
|
||||||
|
1.251f, // 밀도
|
||||||
|
0.0253f, // 빛 강도
|
||||||
|
0.9f, // 산란 계수
|
||||||
|
1.78f // 깊이 분포 계수
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_pGameInstance->Setting_Volumetirc(
|
||||||
|
0.626f, // 밀도
|
||||||
|
0.01f, // 빛 강도
|
||||||
|
0.11f, // 산란 계수
|
||||||
|
1.0f // 깊이 분포 계수
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CLevel_GamePlay::Ready_Background()
|
HRESULT CLevel_GamePlay::Ready_Background()
|
||||||
{
|
{
|
||||||
CTerrain::TERRAIN_DESC Terrain_Desc = {};
|
CTerrain::TERRAIN_DESC Terrain_Desc = {};
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ HRESULT CLight_Main::Initialize(void* pArg)
|
|||||||
if (FAILED(__super::Initialize(pArg))){
|
if (FAILED(__super::Initialize(pArg))){
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
if (FAILED(Ready_Components())){
|
if (FAILED(Ready_Components(pArg))){
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(-1.716f, 0.121f, 0.211f, 0.f));
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,20 +93,18 @@ HRESULT CLight_Main::Capture_PreShadow()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CLight_Main::Ready_Components()
|
HRESULT CLight_Main::Ready_Components(void* pArg)
|
||||||
{
|
{
|
||||||
__super::Ready_Components(nullptr);
|
__super::Ready_Components(nullptr);
|
||||||
|
|
||||||
m_pTransformCom->LookAt(XMVectorSet(1.f, -4.f, 1.f, 1.f));
|
LIGHT_DESC* pLightDescArg = static_cast<LIGHT_DESC*>(pArg);
|
||||||
|
|
||||||
LIGHT_DESC LightDesc{};
|
LIGHT_DESC LightDesc{};
|
||||||
|
|
||||||
LightDesc.eType = LIGHT::DIRECTIONAL;
|
LightDesc.eType = LIGHT::DIRECTIONAL;
|
||||||
//LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f);
|
LightDesc.vDiffuse = pLightDescArg->vDiffuse;
|
||||||
//LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f);
|
LightDesc.vAmbient = pLightDescArg->vAmbient;
|
||||||
//LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
|
LightDesc.vSpecular = pLightDescArg->vSpecular;
|
||||||
LightDesc.vDiffuse = _float4(0.3f, 0.3f, 0.1f, 0.f);
|
|
||||||
LightDesc.vAmbient = _float4(0.12f, 0.12f, 0.24f, 0.f);
|
|
||||||
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
|
|
||||||
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
|
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
|
||||||
LightDesc.iLevel = NEXT_LEVEL;
|
LightDesc.iLevel = NEXT_LEVEL;
|
||||||
|
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ class CLevel_GamePlay final : public CLevel
|
|||||||
private:
|
private:
|
||||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||||
class CBroomRaceManager* m_pBroomRaceManager = { nullptr };
|
class CBroomRaceManager* m_pBroomRaceManager = { nullptr };
|
||||||
|
|
||||||
|
_bool m_isDay = { true };
|
||||||
private:
|
private:
|
||||||
virtual HRESULT Initialize() override;
|
virtual HRESULT Initialize() override;
|
||||||
HRESULT Initialize(void* pArg);
|
HRESULT Initialize(void* pArg);
|
||||||
HRESULT Ready_Lights();
|
HRESULT Ready_Lights();
|
||||||
|
HRESULT Ready_Volumetric();
|
||||||
HRESULT Ready_Background();
|
HRESULT Ready_Background();
|
||||||
HRESULT Ready_Layer_Hogsmeade();
|
HRESULT Ready_Layer_Hogsmeade();
|
||||||
HRESULT Ready_Layer_Hogwart();
|
HRESULT Ready_Layer_Hogwart();
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class CLight_Main final : public CGameObject
|
|||||||
virtual HRESULT Capture_PreShadow();
|
virtual HRESULT Capture_PreShadow();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CLight* m_pLightCom = { nullptr };
|
CLight* m_pLightCom = { nullptr };
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual HRESULT Initialize_Prototype() override;
|
virtual HRESULT Initialize_Prototype() override;
|
||||||
virtual HRESULT Initialize(void* pArg) override;
|
virtual HRESULT Initialize(void* pArg) override;
|
||||||
HRESULT Ready_Components();
|
HRESULT Ready_Components(void* pArg);
|
||||||
HRESULT Bind_ShaderResources();
|
HRESULT Bind_ShaderResources();
|
||||||
_matrix Get_OffCenterProjMatrix(_fmatrix ViewMatrix, vector<_float3>& WorldPositions);
|
_matrix Get_OffCenterProjMatrix(_fmatrix ViewMatrix, vector<_float3>& WorldPositions);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ HRESULT CMainLight::Initialize(void* pArg)
|
|||||||
if (FAILED(Ready_Components()))
|
if (FAILED(Ready_Components()))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f));
|
m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(-1.716f, 0.121f, 0.211f, 0.f));
|
||||||
|
|
||||||
m_pGameTime = CGameTime::Create();
|
m_pGameTime = CGameTime::Create();
|
||||||
|
|
||||||
@@ -134,16 +134,13 @@ HRESULT CMainLight::Ready_Components()
|
|||||||
LIGHT_DESC LightDesc{};
|
LIGHT_DESC LightDesc{};
|
||||||
|
|
||||||
LightDesc.eType = LIGHT::DIRECTIONAL;
|
LightDesc.eType = LIGHT::DIRECTIONAL;
|
||||||
LightDesc.vDiffuse = _float4(0.3f, 0.3f, 0.1f, 0.f);
|
LightDesc.vDiffuse = _float4(0.3294f, 0.4824f, 0.4824f, 0.0314f);
|
||||||
LightDesc.vAmbient = _float4(0.3f, 0.3f, 0.5f, 0.f);
|
LightDesc.vAmbient = _float4(0.1608f, 0.1608f, 0.1608f, 0.0f);
|
||||||
LightDesc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.f);
|
LightDesc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.f);
|
||||||
|
m_pTransformCom->Rotation(XMConvertToRadians(-4.f), XMConvertToRadians(271.f), 0.f);
|
||||||
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
|
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
|
||||||
LightDesc.iLevel = NEXT_LEVEL;
|
LightDesc.iLevel = NEXT_LEVEL;
|
||||||
|
|
||||||
#ifdef gimch
|
|
||||||
LightDesc.vDiffuse = _float4(0.745f, 0.797f, 0.8f, 0.f);
|
|
||||||
LightDesc.vAmbient = _float4(0.417f, 0.533f, 0.544f, 0.f);
|
|
||||||
#endif // gimch
|
|
||||||
|
|
||||||
|
|
||||||
/* Com_Light*/
|
/* Com_Light*/
|
||||||
|
|||||||
@@ -220,8 +220,15 @@ void CLight::Describe_Entity()
|
|||||||
|
|
||||||
GUI::Spacing();
|
GUI::Spacing();
|
||||||
|
|
||||||
|
if (m_LightDesc.eType == LIGHT::DIRECTIONAL)
|
||||||
|
{
|
||||||
|
GUI::Text("Direction:");
|
||||||
|
GUI::InputFloat3("##Direction", (_float*)m_LightDesc.pDirection);
|
||||||
|
}
|
||||||
m_pOwner->Get_Component<CTransform>()->Describe_Entity();
|
m_pOwner->Get_Component<CTransform>()->Describe_Entity();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
GUI::TreePop();
|
GUI::TreePop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -193,9 +193,9 @@ void CVolumetric::Describe_Entity()
|
|||||||
_bool open = true;
|
_bool open = true;
|
||||||
GUI::Begin("SYSTEM", &open, IMGUI_GLOBAL_BEGIN_FLAG);
|
GUI::Begin("SYSTEM", &open, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||||
if (GUI::CollapsingHeader("VOLUMETRIC")) {
|
if (GUI::CollapsingHeader("VOLUMETRIC")) {
|
||||||
GUI::SliderFloat("Density", &m_fDensity,0.01f, 5.f);
|
GUI::SliderFloat("Density", &m_fDensity,0.001f, 5.f);
|
||||||
GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.01f, 5.f);
|
GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.01f, 0.5f, "%.4f");
|
||||||
GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, 0.01f, 5.f);
|
GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, -0.9f, 0.9f, "%.4f");
|
||||||
GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f);
|
GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f);
|
||||||
}
|
}
|
||||||
GUI::End();
|
GUI::End();
|
||||||
|
|||||||
@@ -71,10 +71,10 @@ class CVolumetric final : public CBase
|
|||||||
ID3D11ComputeShader* m_pCSVolumeAccumulate = { nullptr };
|
ID3D11ComputeShader* m_pCSVolumeAccumulate = { nullptr };
|
||||||
ID3DBlob* m_pCSBlobAccumulate = { nullptr };
|
ID3DBlob* m_pCSBlobAccumulate = { nullptr };
|
||||||
|
|
||||||
_float m_fDensity = { 0.5f };
|
_float m_fDensity = { 0.953f }; // 밀도
|
||||||
_float m_fLightIntensity = { 1.f };
|
_float m_fLightIntensity = { 0.01f }; // 광원 강도
|
||||||
_float m_fAsymmetryParameter = { 0.2f };
|
_float m_fAsymmetryParameter = { 0.5344f }; // 이방성 계수 값이 클 수록 들어오는 방향으로 나가는 빛의 양이 많아짐
|
||||||
_float m_fDepthPackExponent = { 2.f };
|
_float m_fDepthPackExponent = { 1.f }; // 깊이 비선형 분포 지수
|
||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
class CRenderEventDebugger m_AnnotationHelper = {};
|
class CRenderEventDebugger m_AnnotationHelper = {};
|
||||||
|
|||||||
Reference in New Issue
Block a user