Patch Update - Start ShaderSkybox - V9.3.1

This commit is contained in:
CatChow0 2025-05-01 17:16:11 +02:00
parent e34b44996a
commit f1c13a3c8c
7 changed files with 90 additions and 8 deletions

View File

@ -5,14 +5,12 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
<change afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/Skybox.h" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Skybox.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enginecustom/src/inc/shader/SkyboxShaderClass.h" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enginecustom/src/src/shader/SkyboxShaderClass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/assets/Texture/imgui.ini" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/assets/Texture/imgui.ini" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/enginecustom.vcxproj" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/Positionclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/Positionclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/shader/shadermanagerclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/shader/shadermanagerclass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/shader/shadermanagerclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/shader/shadermanagerclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -167,7 +165,7 @@
<workItem from="1743355837694" duration="1514000" />
<workItem from="1743370106270" duration="901000" />
<workItem from="1743505399891" duration="2361000" />
<workItem from="1746106963725" duration="3390000" />
<workItem from="1746106963725" duration="5546000" />
</task>
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
<option name="closed" value="true" />

View File

@ -41,6 +41,7 @@
<ClCompile Include="src\src\shader\reflectionshaderclass.cpp" />
<ClCompile Include="src\src\shader\refractionshaderclass.cpp" />
<ClCompile Include="src\src\shader\shadermanagerclass.cpp" />
<ClCompile Include="src\src\shader\SkyboxShaderClass.cpp" />
<ClCompile Include="src\src\shader\specmapshaderclass.cpp" />
<ClCompile Include="src\src\shader\sunlightshaderclass.cpp" />
<ClCompile Include="src\src\shader\textureshaderclass.cpp" />
@ -100,6 +101,7 @@
<ClInclude Include="src\inc\shader\reflectionshaderclass.h" />
<ClInclude Include="src\inc\shader\refractionshaderclass.h" />
<ClInclude Include="src\inc\shader\shadermanagerclass.h" />
<ClInclude Include="src\inc\shader\SkyboxShaderClass.h" />
<ClInclude Include="src\inc\shader\specmapshaderclass.h" />
<ClInclude Include="src\inc\shader\sunlightshaderclass.h" />
<ClInclude Include="src\inc\shader\textureshaderclass.h" />

View File

@ -0,0 +1,14 @@
#pragma once
#include <d3d11.h>
#include <d3dcompiler.h>
#include <directxmath.h>
using namespace DirectX;
using namespace std;
class SkyboxShaderClass
{
public:
};

View File

@ -17,6 +17,7 @@
#include "refractionshaderclass.h"
#include "watershaderclass.h"
#include "celshadingshader.h"
#include "SkyboxShaderClass.h"
#include "sunlightshaderclass.h"
using namespace DirectX;
@ -44,6 +45,21 @@ public:
bool RenderWaterShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
bool RenderCelShadingShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
bool RenderSunlightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
bool RenderSkyboxShader(
ID3D11DeviceContext* deviceContext,
int indexCount,
XMMATRIX worldMatrix,
XMMATRIX viewMatrix,
XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* front,
ID3D11ShaderResourceView* back,
ID3D11ShaderResourceView* left,
ID3D11ShaderResourceView* right,
ID3D11ShaderResourceView* top,
ID3D11ShaderResourceView* bottom,
XMFLOAT4 sunDiffuseColor
);
private:
TextureShaderClass* m_TextureShader;
NormalMapShaderClass* m_NormalMapShader;
@ -58,6 +74,7 @@ private:
WaterShaderClass* m_WaterShader;
CelshadeClass* m_CelShadingShader;
SunlightShaderClass* m_SunlightShader;
SkyboxShaderClass* m_SkyboxShader;
};
#endif

View File

@ -0,0 +1 @@
#include "SkyboxShaderClass.h"

View File

@ -141,6 +141,14 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
return false;
}
m_SkyboxShader = new SkyboxShaderClass;
result = m_SkyboxShader->Initialize(device, hwnd);
if (!result)
{
Logger::Get().Log("Error initializing SkyboxShaderClass", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
Logger::Get().Log("ShaderManagerClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
@ -253,6 +261,13 @@ void ShaderManagerClass::Shutdown()
m_SunlightShader = 0;
}
if (m_SkyboxShader)
{
m_SkyboxShader->Shutdown();
delete m_SkyboxShader;
m_SkyboxShader = 0;
}
Logger::Get().Log("ShaderManagerClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown);
}
@ -447,4 +462,17 @@ bool ShaderManagerClass::RenderSunlightShader(ID3D11DeviceContext* deviceContext
}
return true;
}
}
bool ShaderManagerClass::RenderSkyboxShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, ID3D11ShaderResourceView* front, ID3D11ShaderResourceView* back, ID3D11ShaderResourceView* left, ID3D11ShaderResourceView* right, ID3D11ShaderResourceView* top, ID3D11ShaderResourceView* bottom, XMFLOAT4 sunDiffuseColor)
{
bool result;
result = m_SkyboxShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, front, back, left, right, top, bottom, sunDiffuseColor);
if (!result)
{
return false;
}
return true;
}

View File

@ -1955,6 +1955,28 @@ bool ApplicationClass::RenderPass(const std::vector<std::reference_wrapper<std::
}
break;
case ShaderType::SKYBOX:
result = m_ShaderManager->RenderSkyboxShader(
m_Direct3D->GetDeviceContext(),
object->GetIndexCount(),
worldMatrix,
view,
projection,
object->GetTexture(0), // Front
object->GetTexture(1), // Back
object->GetTexture(2), // Left
object->GetTexture(3), // Right
object->GetTexture(4), // Top
object->GetTexture(5), // Bottom
m_SunLight->GetDiffuseColor() // Sunlight color to tint the skybox
);
if (!result)
{
Logger::Get().Log("Could not render the object model using the skybox shader", __FILE__, __LINE__, Logger::LogLevel::Error);
return false;
}
break;
case ShaderType::SUNLIGHT:
result = m_ShaderManager->RenderSunlightShader(
m_Direct3D->GetDeviceContext(),