From cf147720184e0a1a553e8897d9504515e416b3f0 Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Tue, 2 Apr 2024 12:56:47 +0200
Subject: [PATCH 01/13] Shader manager
Erreur de transformation
---
enginecustom/applicationclass.cpp | 177 ++++++++++++----------
enginecustom/applicationclass.h | 8 +-
enginecustom/enginecustom.vcxproj | 2 +
enginecustom/enginecustom.vcxproj.filters | 6 +
enginecustom/shadermanagerclass.cpp | 129 ++++++++++++++++
enginecustom/shadermanagerclass.h | 34 +++++
6 files changed, 272 insertions(+), 84 deletions(-)
create mode 100644 enginecustom/shadermanagerclass.cpp
create mode 100644 enginecustom/shadermanagerclass.h
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 8ea3373..47da0b4 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -22,8 +22,7 @@ ApplicationClass::ApplicationClass()
m_TextString3 = 0;
m_Fps = 0;
m_FpsString = 0;
- m_NormalMapShader = 0;
- m_SpecMapShader = 0;
+ m_ShaderManager = 0;
}
@@ -74,25 +73,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
m_Camera->SetPosition(0.0f, 0.0f, -12.0f);
m_Camera->SetRotation(0.0f, 0.0f, 0.0f);
- // Create and initialize the specular map shader object.
- m_SpecMapShader = new SpecMapShaderClass;
-
- result = m_SpecMapShader->Initialize(m_Direct3D->GetDevice(), hwnd);
- if (!result)
- {
- MessageBox(hwnd, L"Could not initialize the specular map shader object.", L"Error", MB_OK);
- return false;
- }
-
- // Create and initialize the normal map shader object.
- m_NormalMapShader = new NormalMapShaderClass;
-
- result = m_NormalMapShader->Initialize(m_Direct3D->GetDevice(), hwnd);
- if (!result)
- {
- MessageBox(hwnd, L"Could not initialize the normal map shader object.", L"Error", MB_OK);
- return false;
- }
+ return true;
// Create and initialize the font shader object.
m_FontShader = new FontShaderClass;
@@ -262,25 +243,15 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
m_Light->SetSpecularColor(1.0f, 1.0f, 1.0f, 1.0f);
m_Light->SetSpecularPower(16.0f);
- // Set the number of lights we will use.
- m_numLights = 4;
- // Create and initialize the light objects array.
- m_Lights = new LightClass[m_numLights];
-
- // Manually set the color and position of each light.
- m_Lights[0].SetDiffuseColor(1.0f, 0.0f, 0.0f, 1.0f); // Red
- m_Lights[0].SetPosition(-3.0f, 1.0f, 3.0f);
-
- m_Lights[1].SetDiffuseColor(0.0f, 1.0f, 0.0f, 1.0f); // Green
- m_Lights[1].SetPosition(3.0f, 1.0f, 3.0f);
-
- m_Lights[2].SetDiffuseColor(0.0f, 0.0f, 1.0f, 1.0f); // Blue
- m_Lights[2].SetPosition(-3.0f, 1.0f, -3.0f);
-
- m_Lights[3].SetDiffuseColor(1.0f, 1.0f, 1.0f, 1.0f); // White
- m_Lights[3].SetPosition(3.0f, 1.0f, -3.0f);
+ // Create and initialize the normal map shader object.
+ m_ShaderManager = new ShaderManagerClass;
+ result = m_ShaderManager->Initialize(m_Direct3D->GetDevice(), hwnd);
+ if (!result)
+ {
+ return false;
+ }
// Create and initialize the light map shader object.
m_LightMapShader = new LightMapShaderClass;
@@ -326,6 +297,14 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
void ApplicationClass::Shutdown()
{
+ // Release the shader manager object.
+ if (m_ShaderManager)
+ {
+ m_ShaderManager->Shutdown();
+ delete m_ShaderManager;
+ m_ShaderManager = 0;
+ }
+
// Release the text objects for the mouse strings.
if (m_MouseStrings)
{
@@ -404,12 +383,12 @@ void ApplicationClass::Shutdown()
m_Sprite = 0;
}
- // Release the light objects.
- if(m_Lights)
- {
- delete [] m_Lights;
- m_Lights = 0;
- }
+ // Release the light object.
+ if (m_Light)
+ {
+ delete m_Light;
+ m_Light = 0;
+ }
// Release the light shader object.
if (m_LightShader)
@@ -427,22 +406,6 @@ void ApplicationClass::Shutdown()
m_Model = 0;
}
- // Release the specular map shader object.
- if (m_SpecMapShader)
- {
- m_SpecMapShader->Shutdown();
- delete m_SpecMapShader;
- m_SpecMapShader = 0;
- }
-
- // Release the normal map shader object.
- if (m_NormalMapShader)
- {
- m_NormalMapShader->Shutdown();
- delete m_NormalMapShader;
- m_NormalMapShader = 0;
- }
-
// Release the multitexture shader object.
if (m_MultiTextureShader)
{
@@ -500,9 +463,9 @@ bool ApplicationClass::Frame(InputClass* Input)
float frameTime;
static float rotation = 360.0f;
- static float x = 6.f;
- static float y = 3.f;
- static float z = 0.f;
+ static float x = 0.f;
+ static float y = 0.f;
+ static float z = -8.f;
// Check if the user pressed escape and wants to exit the application.
if (Input->IsEscapePressed())
@@ -524,13 +487,13 @@ bool ApplicationClass::Frame(InputClass* Input)
rotation += 360.0f;
}
- // Update the x position variable each frame.
- x -= 0.0174532925f * 0.6f;
+ //// Update the x position variable each frame.
+ //x -= 0.0174532925f * 0.6f;
- y -= 0.0174532925f * 0.2f;
+ //y -= 0.0174532925f * 0.2f;
- // Update the z position variable each frame.
- z -= 0.0174532925f * 0.2f;
+ //// Update the z position variable each frame.
+ //z -= 0.0174532925f * 0.2f;
// Render the graphics scene.
@@ -540,6 +503,64 @@ bool ApplicationClass::Frame(InputClass* Input)
return false;
}
+ XMMATRIX worldMatrix, viewMatrix, projectionMatrix, rotateMatrix, translateMatrix;
+
+ // Clear the buffers to begin the scene.
+ m_Direct3D->BeginScene(0.0f, 0.0f, 0.0f, 1.0f);
+
+ // Get the world, view, and projection matrices from the camera and d3d objects.
+ m_Direct3D->GetWorldMatrix(worldMatrix);
+ m_Camera->GetViewMatrix(viewMatrix);
+ m_Direct3D->GetProjectionMatrix(projectionMatrix);
+
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(0.0f, 1.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the texture shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0));
+ if (!result)
+ {
+ return false;
+ }
+
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(-1.5f, -1.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the light shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderLightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), m_Light->GetDirection(), m_Light->GetDiffuseColor());
+ if (!result)
+ {
+ return false;
+ }
+
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(1.5f, -1.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the normal map shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderNormalMapShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), m_Model->GetTexture(1), m_Light->GetDirection(), m_Light->GetDiffuseColor());
+ if (!result)
+ {
+ return false;
+ }
+
+ // Present the rendered scene to the screen.
+ m_Direct3D->EndScene();
+
// Get the location of the mouse from the input object,
Input->GetMouseLocation(mouseX, mouseY);
@@ -672,15 +693,15 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
return false;
}
- // Get the light properties.
- for (i = 0; i < m_numLights; i++)
- {
- // Create the diffuse color array from the four light colors.
- diffuseColor[i] = m_Lights[i].GetDiffuseColor();
+ //// Get the light properties.
+ //for (i = 0; i < m_numLights; i++)
+ //{
+ // // Create the diffuse color array from the four light colors.
+ // diffuseColor[i] = m_Lights[i].GetDiffuseColor();
- // Create the light position array from the four light positions.
- lightPosition[i] = m_Lights[i].GetPosition();
- }
+ // // Create the light position array from the four light positions.
+ // lightPosition[i] = m_Lights[i].GetPosition();
+ //}
scaleMatrix = XMMatrixScaling(0.75f, 0.75f, 0.75f); // Build the scaling matrix.
rotateMatrix = XMMatrixRotationY(rotation); // Build the rotation matrix.
@@ -734,13 +755,13 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
//}
//Specular Mapping
- result = m_SpecMapShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ /*result = m_SpecMapShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_Model->GetTexture(0), m_Model->GetTexture(1), m_Model->GetTexture(2), m_Light->GetDirection(), m_Light->GetDiffuseColor(),
m_Camera->GetPosition(), m_Light->GetSpecularColor(), m_Light->GetSpecularPower());
if (!result)
{
return false;
- }
+ }*/
// Enable the Z buffer and disable alpha blending now that 2D rendering is complete.
m_Direct3D->TurnZBufferOn();
diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h
index 1c3bc25..ffcac3c 100644
--- a/enginecustom/applicationclass.h
+++ b/enginecustom/applicationclass.h
@@ -14,7 +14,6 @@
#include "multitextureshaderclass.h"
#include "alphamapshaderclass.h"
#include "bitmapclass.h"
-#include "textureshaderclass.h"
#include "spriteclass.h"
#include "timerclass.h"
#include "fontshaderclass.h"
@@ -22,8 +21,7 @@
#include "textclass.h"
#include "fpsclass.h"
#include "inputclass.h"
-#include "normalmapshaderclass.h"
-#include "specmapshaderclass.h"
+#include "shadermanagerclass.h"
/////////////
@@ -68,7 +66,6 @@ private:
SpriteClass* m_Sprite;
TimerClass* m_Timer;
TextClass* m_MouseStrings;
- LightClass* m_Lights;
int m_numLights;
FontShaderClass* m_FontShader;
FontClass* m_Font;
@@ -76,8 +73,7 @@ private:
FpsClass* m_Fps;
TextClass* m_FpsString;
int m_previousFps;
- NormalMapShaderClass* m_NormalMapShader;
- SpecMapShaderClass* m_SpecMapShader;
+ ShaderManagerClass* m_ShaderManager;
};
#endif
diff --git a/enginecustom/enginecustom.vcxproj b/enginecustom/enginecustom.vcxproj
index 2d54fd5..99273a3 100644
--- a/enginecustom/enginecustom.vcxproj
+++ b/enginecustom/enginecustom.vcxproj
@@ -37,6 +37,7 @@
+
@@ -62,6 +63,7 @@
+
diff --git a/enginecustom/enginecustom.vcxproj.filters b/enginecustom/enginecustom.vcxproj.filters
index 1a53214..4b67cfa 100644
--- a/enginecustom/enginecustom.vcxproj.filters
+++ b/enginecustom/enginecustom.vcxproj.filters
@@ -99,6 +99,9 @@
Fichiers sources
+
+ Fichiers sources
+
@@ -170,6 +173,9 @@
Fichiers d%27en-tête
+
+ Fichiers d%27en-tête
+
diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/shadermanagerclass.cpp
new file mode 100644
index 0000000..c469c17
--- /dev/null
+++ b/enginecustom/shadermanagerclass.cpp
@@ -0,0 +1,129 @@
+#include "shadermanagerclass.h"
+
+ShaderManagerClass::ShaderManagerClass()
+{
+ m_TextureShader = 0;
+ m_LightShader = 0;
+ m_NormalMapShader = 0;
+}
+
+
+ShaderManagerClass::ShaderManagerClass(const ShaderManagerClass& other)
+{
+}
+
+
+ShaderManagerClass::~ShaderManagerClass()
+{
+}
+
+
+bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
+{
+ bool result;
+
+ // Create and initialize the texture shader object.
+ m_TextureShader = new TextureShaderClass;
+
+ result = m_TextureShader->Initialize(device, hwnd);
+ if (!result)
+ {
+ return false;
+ }
+
+ // Create and initialize the light shader object.
+ m_LightShader = new LightShaderClass;
+
+ result = m_LightShader->Initialize(device, hwnd);
+ if (!result)
+ {
+ return false;
+ }
+
+ // Create and initialize the normal map shader object.
+ m_NormalMapShader = new NormalMapShaderClass;
+
+ result = m_NormalMapShader->Initialize(device, hwnd);
+ if (!result)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+void ShaderManagerClass::Shutdown()
+{
+ // Release the normal map shader object.
+ if (m_NormalMapShader)
+ {
+ m_NormalMapShader->Shutdown();
+ delete m_NormalMapShader;
+ m_NormalMapShader = 0;
+ }
+
+ // Release the light shader object.
+ if (m_LightShader)
+ {
+ m_LightShader->Shutdown();
+ delete m_LightShader;
+ m_LightShader = 0;
+ }
+
+ // Release the texture shader object.
+ if (m_TextureShader)
+ {
+ m_TextureShader->Shutdown();
+ delete m_TextureShader;
+ m_TextureShader = 0;
+ }
+
+ return;
+}
+
+bool ShaderManagerClass::RenderTextureShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
+ ID3D11ShaderResourceView* texture)
+{
+ bool result;
+
+
+ result = m_TextureShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture);
+ if (!result)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+
+bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
+ ID3D11ShaderResourceView* texture, XMFLOAT4 lightDirection, XMFLOAT4 diffuseColor)
+{
+ bool result;
+
+
+ result = m_LightShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection, diffuseColor);
+ if (!result)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+
+bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
+ ID3D11ShaderResourceView* colorTexture, ID3D11ShaderResourceView* normalTexture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
+{
+ bool result;
+
+
+ result = m_NormalMapShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, colorTexture, normalTexture, lightDirection, diffuseColor);
+ if (!result)
+ {
+ return false;
+ }
+
+ return true;
+}
diff --git a/enginecustom/shadermanagerclass.h b/enginecustom/shadermanagerclass.h
new file mode 100644
index 0000000..cdcbd15
--- /dev/null
+++ b/enginecustom/shadermanagerclass.h
@@ -0,0 +1,34 @@
+#ifndef _SHADERMANAGERCLASS_H_
+#define _SHADERMANAGERCLASS_H_
+
+///////////////////////
+// MY CLASS INCLUDES //
+///////////////////////
+#include "textureshaderclass.h"
+#include "lightshaderclass.h"
+#include "normalmapshaderclass.h"
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Class name: ShaderManagerClass
+////////////////////////////////////////////////////////////////////////////////
+class ShaderManagerClass
+{
+public:
+ ShaderManagerClass();
+ ShaderManagerClass(const ShaderManagerClass&);
+ ~ShaderManagerClass();
+
+ bool Initialize(ID3D11Device*, HWND);
+ void Shutdown();
+ bool RenderTextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
+ bool RenderLightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
+ bool RenderNormalMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
+
+private:
+ TextureShaderClass* m_TextureShader;
+ LightShaderClass* m_LightShader;
+ NormalMapShaderClass* m_NormalMapShader;
+};
+
+#endif
From 83c85cfa29589b59a67485c328188582cfb29dd5 Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Tue, 2 Apr 2024 13:03:22 +0200
Subject: [PATCH 02/13] t
---
enginecustom/shadermanagerclass.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/shadermanagerclass.cpp
index c469c17..4aed5f6 100644
--- a/enginecustom/shadermanagerclass.cpp
+++ b/enginecustom/shadermanagerclass.cpp
@@ -98,7 +98,7 @@ bool ShaderManagerClass::RenderTextureShader(ID3D11DeviceContext* deviceContext,
bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
- ID3D11ShaderResourceView* texture, XMFLOAT4 lightDirection, XMFLOAT4 diffuseColor)
+ ID3D11ShaderResourceView* texture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
bool result;
From cb1187b358f5f3a434210062274adabc091c0dcb Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Wed, 3 Apr 2024 12:15:53 +0200
Subject: [PATCH 03/13] La fenetre se referme instant
---
enginecustom/applicationclass.cpp | 95 +++++++++++------------------
enginecustom/shadermanagerclass.cpp | 13 +++-
2 files changed, 49 insertions(+), 59 deletions(-)
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 47da0b4..6b46f2c 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -503,64 +503,6 @@ bool ApplicationClass::Frame(InputClass* Input)
return false;
}
- XMMATRIX worldMatrix, viewMatrix, projectionMatrix, rotateMatrix, translateMatrix;
-
- // Clear the buffers to begin the scene.
- m_Direct3D->BeginScene(0.0f, 0.0f, 0.0f, 1.0f);
-
- // Get the world, view, and projection matrices from the camera and d3d objects.
- m_Direct3D->GetWorldMatrix(worldMatrix);
- m_Camera->GetViewMatrix(viewMatrix);
- m_Direct3D->GetProjectionMatrix(projectionMatrix);
-
- // Setup matrices.
- rotateMatrix = XMMatrixRotationY(rotation);
- translateMatrix = XMMatrixTranslation(0.0f, 1.0f, 0.0f);
- worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
-
- // Render the model using the texture shader.
- m_Model->Render(m_Direct3D->GetDeviceContext());
-
- result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
- m_Model->GetTexture(0));
- if (!result)
- {
- return false;
- }
-
- // Setup matrices.
- rotateMatrix = XMMatrixRotationY(rotation);
- translateMatrix = XMMatrixTranslation(-1.5f, -1.0f, 0.0f);
- worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
-
- // Render the model using the light shader.
- m_Model->Render(m_Direct3D->GetDeviceContext());
-
- result = m_ShaderManager->RenderLightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
- m_Model->GetTexture(0), m_Light->GetDirection(), m_Light->GetDiffuseColor());
- if (!result)
- {
- return false;
- }
-
- // Setup matrices.
- rotateMatrix = XMMatrixRotationY(rotation);
- translateMatrix = XMMatrixTranslation(1.5f, -1.0f, 0.0f);
- worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
-
- // Render the model using the normal map shader.
- m_Model->Render(m_Direct3D->GetDeviceContext());
-
- result = m_ShaderManager->RenderNormalMapShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
- m_Model->GetTexture(0), m_Model->GetTexture(1), m_Light->GetDirection(), m_Light->GetDiffuseColor());
- if (!result)
- {
- return false;
- }
-
- // Present the rendered scene to the screen.
- m_Direct3D->EndScene();
-
// Get the location of the mouse from the input object,
Input->GetMouseLocation(mouseX, mouseY);
@@ -714,6 +656,43 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
// Render the model using the multitexture shader.
m_Model->Render(m_Direct3D->GetDeviceContext());
+ result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0));
+ if (!result)
+ {
+ return false;
+ }
+
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(-1.5f, -1.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the light shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderLightShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), m_Light->GetDirection(), m_Light->GetDiffuseColor());
+ if (!result)
+ {
+ return false;
+ }
+
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(1.5f, -1.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the normal map shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderNormalMapShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), m_Model->GetTexture(1), m_Light->GetDirection(), m_Light->GetDiffuseColor());
+ if (!result)
+ {
+ return false;
+ }
+
// Lighting, utilise plusieurs lights donc Multiple Points Lighting
//result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
// diffuseColor, lightPosition);
diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/shadermanagerclass.cpp
index 4aed5f6..65c02cd 100644
--- a/enginecustom/shadermanagerclass.cpp
+++ b/enginecustom/shadermanagerclass.cpp
@@ -102,17 +102,28 @@ bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, i
{
bool result;
+ // Allouer de la mémoire pour stocker XMFLOAT4 pour la direction de la lumière
+ XMFLOAT4* lightDirection4Ptr = new XMFLOAT4(lightDirection.x, lightDirection.y, lightDirection.z, 1.0f);
- result = m_LightShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection, diffuseColor);
+ // Allouer de la mémoire pour stocker XMFLOAT4 pour la couleur diffuse
+ XMFLOAT4* diffuseColorPtr = new XMFLOAT4(diffuseColor);
+
+ result = m_LightShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture, lightDirection4Ptr, diffuseColorPtr);
if (!result)
{
+ delete lightDirection4Ptr;
+ delete diffuseColorPtr;
return false;
}
+ delete lightDirection4Ptr;
+ delete diffuseColorPtr;
return true;
}
+
+
bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* colorTexture, ID3D11ShaderResourceView* normalTexture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
From b52231c747e843f0f8fd2878410153fb7c15c323 Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Wed, 3 Apr 2024 13:01:42 +0200
Subject: [PATCH 04/13] Ajout multitexturing au Shader Manager
PS: La fenetre ne s'ouvre toujours pas
---
enginecustom/shadermanagerclass.cpp | 36 +++++++++++++++++++++++++----
enginecustom/shadermanagerclass.h | 3 +++
2 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/shadermanagerclass.cpp
index 65c02cd..8704145 100644
--- a/enginecustom/shadermanagerclass.cpp
+++ b/enginecustom/shadermanagerclass.cpp
@@ -49,6 +49,15 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
return false;
}
+ // Create and initialize the multitexture shader object.
+ m_MultitextureShader = new MultiTextureShaderClass;
+
+ result = m_MultitextureShader->Initialize(device, hwnd);
+ if (!result)
+ {
+ return false;
+ }
+
return true;
}
@@ -78,6 +87,14 @@ void ShaderManagerClass::Shutdown()
m_TextureShader = 0;
}
+ // Release the multitexture shader object.
+ if (m_MultitextureShader)
+ {
+ m_MultitextureShader->Shutdown();
+ delete m_MultitextureShader;
+ m_MultitextureShader = 0;
+ }
+
return;
}
@@ -96,7 +113,6 @@ bool ShaderManagerClass::RenderTextureShader(ID3D11DeviceContext* deviceContext,
return true;
}
-
bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
@@ -121,9 +137,6 @@ bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, i
return true;
}
-
-
-
bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* colorTexture, ID3D11ShaderResourceView* normalTexture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
@@ -138,3 +151,18 @@ bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContex
return true;
}
+
+bool ShaderManagerClass::RenderMultitextureShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
+ ID3D11ShaderResourceView* texture1, ID3D11ShaderResourceView* texture2)
+{
+ bool result;
+
+
+ result = m_MultitextureShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture1, texture2);
+ if (!result)
+ {
+ return false;
+ }
+
+ return true;
+}
\ No newline at end of file
diff --git a/enginecustom/shadermanagerclass.h b/enginecustom/shadermanagerclass.h
index cdcbd15..ee260d8 100644
--- a/enginecustom/shadermanagerclass.h
+++ b/enginecustom/shadermanagerclass.h
@@ -7,6 +7,7 @@
#include "textureshaderclass.h"
#include "lightshaderclass.h"
#include "normalmapshaderclass.h"
+#include "Multitextureshaderclass.h"
////////////////////////////////////////////////////////////////////////////////
@@ -24,11 +25,13 @@ public:
bool RenderTextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
bool RenderLightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
bool RenderNormalMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
+ bool RenderMultitextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
private:
TextureShaderClass* m_TextureShader;
LightShaderClass* m_LightShader;
NormalMapShaderClass* m_NormalMapShader;
+ MultiTextureShaderClass* m_MultitextureShader;
};
#endif
From b37993f23cf2fd66f6d8cadd7e535ced9cf8b9fc Mon Sep 17 00:00:00 2001
From: Mamitiana RASOLOJAONA
Date: Thu, 4 Apr 2024 09:50:51 +0200
Subject: [PATCH 05/13] correction ecran noir
---
enginecustom/applicationclass.cpp | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 6b46f2c..c82f0ea 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -73,7 +73,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
m_Camera->SetPosition(0.0f, 0.0f, -12.0f);
m_Camera->SetRotation(0.0f, 0.0f, 0.0f);
- return true;
+
// Create and initialize the font shader object.
m_FontShader = new FontShaderClass;
@@ -289,8 +289,6 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
return false;
}
-
-
return true;
}
From b5d597b64e6ff62f08e77b9c7679d80be849da35 Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Thu, 4 Apr 2024 10:50:37 +0200
Subject: [PATCH 06/13] bug bug bug mais integrer
---
enginecustom/Translate.xaml | 13 ------
enginecustom/applicationclass.cpp | 63 +++++++++++++++++++++++++++
enginecustom/applicationclass.h | 1 +
enginecustom/enginecustom.vcxproj | 38 +++-------------
enginecustom/packages.config | 4 --
enginecustom/translate.cpp | 18 --------
enginecustom/translate.h | 21 ---------
enginecustom/translateshaderclass.cpp | 4 +-
8 files changed, 72 insertions(+), 90 deletions(-)
delete mode 100644 enginecustom/Translate.xaml
delete mode 100644 enginecustom/packages.config
delete mode 100644 enginecustom/translate.cpp
delete mode 100644 enginecustom/translate.h
diff --git a/enginecustom/Translate.xaml b/enginecustom/Translate.xaml
deleted file mode 100644
index 0780d74..0000000
--- a/enginecustom/Translate.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 0444768..04d83bc 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -29,6 +29,7 @@ ApplicationClass::ApplicationClass()
m_Position = 0;
m_Frustum = 0;
m_DisplayPlane = 0;
+ m_TranslateShader = 0;
}
@@ -262,6 +263,16 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
return false;
}
+ // Create and initialize the translate shader object.
+ m_TranslateShader = new TranslateShaderClass;
+
+ result = m_TranslateShader->Initialize(m_Direct3D->GetDevice(), hwnd);
+ if (!result)
+ {
+ MessageBox(hwnd, L"Could not initialize the translate shader object.", L"Error", MB_OK);
+ return false;
+ }
+
// Create and initialize the light shader object.
m_LightShader = new LightShaderClass;
@@ -395,6 +406,14 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
void ApplicationClass::Shutdown()
{
+ // Release the translate shader object.
+ if (m_TranslateShader)
+ {
+ m_TranslateShader->Shutdown();
+ delete m_TranslateShader;
+ m_TranslateShader = 0;
+ }
+
// Release the frustum class object.
if (m_Frustum)
{
@@ -597,6 +616,7 @@ bool ApplicationClass::Frame(InputClass* Input)
int mouseX, mouseY, currentMouseX, currentMouseY;
bool result, mouseDown, keyDown, buttonQ, buttonD, buttonZ, buttonS, buttonA, buttonE;
float rotationY, rotationX, positionX, positionY, positionZ;
+ static float textureTranslation = 0.0f;
float frameTime;
@@ -705,6 +725,12 @@ bool ApplicationClass::Frame(InputClass* Input)
return false;
}
+ result = RenderTextureTranslation(textureTranslation);
+ if (!result)
+ {
+ return false;
+ }
+
// Check if the mouse has been pressed.
mouseDown = Input->IsMousePressed();
@@ -718,6 +744,43 @@ bool ApplicationClass::Frame(InputClass* Input)
// Update the sprite object using the frame time.
m_Sprite->Update(frameTime);
+ // Increment the texture translation.
+ textureTranslation += 0.01f;
+ if (textureTranslation > 1.0f)
+ {
+ textureTranslation -= 1.0f;
+ }
+
+ return true;
+}
+
+bool ApplicationClass::RenderTextureTranslation(float textureTranslation)
+{
+ XMMATRIX worldMatrix, viewMatrix, projectionMatrix;
+ bool result;
+
+
+ // Clear the buffers to begin the scene.
+ m_Direct3D->BeginScene(0.0f, 0.0f, 0.0f, 1.0f);
+
+ // Get the world, view, and projection matrices from the camera and d3d objects.
+ m_Direct3D->GetWorldMatrix(worldMatrix);
+ m_Camera->GetViewMatrix(viewMatrix);
+ m_Direct3D->GetProjectionMatrix(projectionMatrix);
+
+ // Render the model using the translate shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_TranslateShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), textureTranslation);
+ if (!result)
+ {
+ return false;
+ }
+
+ // Present the rendered scene to the screen.
+ m_Direct3D->EndScene();
+
return true;
}
diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h
index b7241f7..d7d0826 100644
--- a/enginecustom/applicationclass.h
+++ b/enginecustom/applicationclass.h
@@ -61,6 +61,7 @@ private:
bool UpdateFps();
bool UpdateRenderCountString(int);
bool RenderSceneToTexture(float);
+ bool RenderTextureTranslation(static float);
private:
D3DClass* m_Direct3D;
diff --git a/enginecustom/enginecustom.vcxproj b/enginecustom/enginecustom.vcxproj
index db59440..be18868 100644
--- a/enginecustom/enginecustom.vcxproj
+++ b/enginecustom/enginecustom.vcxproj
@@ -1,6 +1,5 @@
-
Debug
@@ -49,10 +48,6 @@
-
- translate.vs
- Code
-
@@ -84,10 +79,6 @@
-
- translate.vs
- Code
-
@@ -103,7 +94,6 @@
-
@@ -115,7 +105,6 @@
Pixel
Pixel
Pixel
- false
Document
@@ -123,7 +112,6 @@
Vertex
Vertex
Vertex
- false
Document
@@ -146,23 +134,19 @@
-
+
Designer
-
-
+ Document
+
+
Designer
-
-
-
-
- Designer
-
+ Document
+
17.0
Win32Proj
{92cf56c4-76bb-40d4-8fe5-36c15f5f127a}
- enginecustom
10.0
@@ -267,14 +251,4 @@
-
-
-
-
-
- Ce projet fait référence à des packages NuGet qui sont manquants sur cet ordinateur. Utilisez l'option de restauration des packages NuGet pour les télécharger. Pour plus d'informations, consultez http://go.microsoft.com/fwlink/?LinkID=322105. Le fichier manquant est : {0}.
-
-
-
-
\ No newline at end of file
diff --git a/enginecustom/packages.config b/enginecustom/packages.config
deleted file mode 100644
index cbf6205..0000000
--- a/enginecustom/packages.config
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/enginecustom/translate.cpp b/enginecustom/translate.cpp
deleted file mode 100644
index 7bf765c..0000000
--- a/enginecustom/translate.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "pch.h"
-#include "Translate.h"
-#if __has_include("Translate.g.cpp")
-#include "Translate.g.cpp"
-#endif
-
-namespace winrt::enginecustom::implementation
-{
- int32_t Translate::MyProperty()
- {
- throw hresult_not_implemented();
- }
-
- void Translate::MyProperty(int32_t /*value*/)
- {
- throw hresult_not_implemented();
- }
-}
diff --git a/enginecustom/translate.h b/enginecustom/translate.h
deleted file mode 100644
index 5e8a544..0000000
--- a/enginecustom/translate.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-
-#include "Translate.g.h"
-
-namespace winrt::enginecustom::implementation
-{
- struct Translate : TranslateT
- {
- Translate() = default;
-
- int32_t MyProperty();
- void MyProperty(int32_t value);
- };
-}
-
-namespace winrt::enginecustom::factory_implementation
-{
- struct Translate : TranslateT
- {
- };
-}
diff --git a/enginecustom/translateshaderclass.cpp b/enginecustom/translateshaderclass.cpp
index 47692f3..8be41d1 100644
--- a/enginecustom/translateshaderclass.cpp
+++ b/enginecustom/translateshaderclass.cpp
@@ -31,14 +31,14 @@ bool TranslateShaderClass::Initialize(ID3D11Device* device, HWND hwnd)
int error;
// Set the filename of the vertex shader.
- error = wcscpy_s(vsFilename, 128, L"../Engine/translate.vs");
+ error = wcscpy_s(vsFilename, 128, L"translate.vs");
if (error != 0)
{
return false;
}
// Set the filename of the pixel shader.
- error = wcscpy_s(psFilename, 128, L"../Engine/translate.ps");
+ error = wcscpy_s(psFilename, 128, L"translate.ps");
if (error != 0)
{
return false;
From 2ab975ce9317971abf8ec3853e0a830df6220f4a Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Thu, 4 Apr 2024 22:15:09 +0200
Subject: [PATCH 07/13] Texture translation fonctionne
---
enginecustom/applicationclass.cpp | 47 ++++---------------------------
enginecustom/applicationclass.h | 3 +-
2 files changed, 7 insertions(+), 43 deletions(-)
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 04d83bc..e3bd39e 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -683,7 +683,7 @@ bool ApplicationClass::Frame(InputClass* Input)
m_Camera->Render();
// Render the graphics scene.
- result = Render(rotation, x, y, z);
+ result = Render(rotation, x, y, z, textureTranslation);
if (!result)
{
return false;
@@ -718,19 +718,6 @@ bool ApplicationClass::Frame(InputClass* Input)
return false;
}
- // Render the graphics scene.
- result = Render(rotation, x, y, z);
- if (!result)
- {
- return false;
- }
-
- result = RenderTextureTranslation(textureTranslation);
- if (!result)
- {
- return false;
- }
-
// Check if the mouse has been pressed.
mouseDown = Input->IsMousePressed();
@@ -751,36 +738,13 @@ bool ApplicationClass::Frame(InputClass* Input)
textureTranslation -= 1.0f;
}
- return true;
-}
-
-bool ApplicationClass::RenderTextureTranslation(float textureTranslation)
-{
- XMMATRIX worldMatrix, viewMatrix, projectionMatrix;
- bool result;
-
-
- // Clear the buffers to begin the scene.
- m_Direct3D->BeginScene(0.0f, 0.0f, 0.0f, 1.0f);
-
- // Get the world, view, and projection matrices from the camera and d3d objects.
- m_Direct3D->GetWorldMatrix(worldMatrix);
- m_Camera->GetViewMatrix(viewMatrix);
- m_Direct3D->GetProjectionMatrix(projectionMatrix);
-
- // Render the model using the translate shader.
- m_Model->Render(m_Direct3D->GetDeviceContext());
-
- result = m_TranslateShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
- m_Model->GetTexture(0), textureTranslation);
+ // Render the graphics scene.
+ result = Render(rotation, x, y, z, textureTranslation);
if (!result)
{
return false;
}
- // Present the rendered scene to the screen.
- m_Direct3D->EndScene();
-
return true;
}
@@ -821,7 +785,7 @@ bool ApplicationClass::RenderSceneToTexture(float rotation)
return true;
}
-bool ApplicationClass::Render(float rotation, float x, float y, float z)
+bool ApplicationClass::Render(float rotation, float x, float y, float z, float textureTranslation)
{
XMMATRIX worldMatrix, viewMatrix, orthoMatrix, projectionMatrix, rotateMatrix, translateMatrix, scaleMatrix, srMatrix;
float positionX, positionY, positionZ, radius;
@@ -848,7 +812,8 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z)
// Render the display plane using the texture shader and the render texture resource.
m_DisplayPlane->Render(m_Direct3D->GetDeviceContext());
- result = m_TextureShader->Render(m_Direct3D->GetDeviceContext(), m_DisplayPlane->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_RenderTexture->GetShaderResourceView());
+ result = m_TranslateShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), textureTranslation);
if (!result)
{
return false;
diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h
index d7d0826..9aad0e7 100644
--- a/enginecustom/applicationclass.h
+++ b/enginecustom/applicationclass.h
@@ -56,12 +56,11 @@ public:
bool Frame(InputClass*);
private:
- bool Render(float, float, float, float);
+ bool Render(float, float, float, float, float);
bool UpdateMouseStrings(int, int, bool);
bool UpdateFps();
bool UpdateRenderCountString(int);
bool RenderSceneToTexture(float);
- bool RenderTextureTranslation(static float);
private:
D3DClass* m_Direct3D;
From 38242fc60b1050fe5f8000fcd14f504c0077dd3d Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Fri, 5 Apr 2024 15:39:00 +0200
Subject: [PATCH 08/13] =?UTF-8?q?Light=20=C3=A0=20reparer?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
enginecustom/applicationclass.cpp | 62 ++++++++++++++++++++++++++++++-
enginecustom/applicationclass.h | 6 +++
2 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index ed372d8..563a6e1 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -85,7 +85,25 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
m_Camera->Render();
m_Camera->GetViewMatrix(m_baseViewMatrix);
-
+ // Create and initialize the specular map shader object.
+ m_SpecMapShader = new SpecMapShaderClass;
+
+ result = m_SpecMapShader->Initialize(m_Direct3D->GetDevice(), hwnd);
+ if (!result)
+ {
+ MessageBox(hwnd, L"Could not initialize the specular map shader object.", L"Error", MB_OK);
+ return false;
+ }
+
+ // Create and initialize the normal map shader object.
+ m_NormalMapShader = new NormalMapShaderClass;
+
+ result = m_NormalMapShader->Initialize(m_Direct3D->GetDevice(), hwnd);
+ if (!result)
+ {
+ MessageBox(hwnd, L"Could not initialize the normal map shader object.", L"Error", MB_OK);
+ return false;
+ }
// Create and initialize the font shader object.
m_FontShader = new FontShaderClass;
@@ -275,6 +293,25 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
m_Light->SetSpecularColor(1.0f, 1.0f, 1.0f, 1.0f);
m_Light->SetSpecularPower(16.0f);
+ // Set the number of lights we will use.
+ m_numLights = 4;
+
+ // Create and initialize the light objects array.
+ m_Lights = new LightClass[m_numLights];
+
+ // Manually set the color and position of each light.
+ m_Lights[0].SetDiffuseColor(1.0f, 0.0f, 0.0f, 1.0f); // Red
+ m_Lights[0].SetPosition(-3.0f, 1.0f, 3.0f);
+
+ m_Lights[1].SetDiffuseColor(0.0f, 1.0f, 0.0f, 1.0f); // Green
+ m_Lights[1].SetPosition(3.0f, 1.0f, 3.0f);
+
+ m_Lights[2].SetDiffuseColor(0.0f, 0.0f, 1.0f, 1.0f); // Blue
+ m_Lights[2].SetPosition(-3.0f, 1.0f, -3.0f);
+
+ m_Lights[3].SetDiffuseColor(1.0f, 1.0f, 1.0f, 1.0f); // White
+ m_Lights[3].SetPosition(3.0f, 1.0f, -3.0f);
+
// Create and initialize the normal map shader object.
m_ShaderManager = new ShaderManagerClass;
@@ -509,6 +546,13 @@ void ApplicationClass::Shutdown()
m_Sprite = 0;
}
+ // Release the light objects.
+ if (m_Lights)
+ {
+ delete[] m_Lights;
+ m_Lights = 0;
+ }
+
// Release the light object.
if (m_Light)
{
@@ -524,6 +568,22 @@ void ApplicationClass::Shutdown()
m_LightShader = 0;
}
+ // Release the normal map shader object.
+ if (m_NormalMapShader)
+ {
+ m_NormalMapShader->Shutdown();
+ delete m_NormalMapShader;
+ m_NormalMapShader = 0;
+ }
+
+ // Release the specular map shader object.
+ if (m_SpecMapShader)
+ {
+ m_SpecMapShader->Shutdown();
+ delete m_SpecMapShader;
+ m_SpecMapShader = 0;
+ }
+
// Release the model object.
if (m_Model)
{
diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h
index f8f11a3..865123c 100644
--- a/enginecustom/applicationclass.h
+++ b/enginecustom/applicationclass.h
@@ -15,12 +15,15 @@
#include "alphamapshaderclass.h"
#include "bitmapclass.h"
#include "spriteclass.h"
+#include "textureshaderclass.h"
#include "timerclass.h"
#include "fontshaderclass.h"
#include "fontclass.h"
#include "textclass.h"
#include "fpsclass.h"
#include "inputclass.h"
+#include "normalmapshaderclass.h"
+#include "specmapshaderclass.h"
#include "shadermanagerclass.h"
#include "modellistclass.h"
#include "positionclass.h"
@@ -65,6 +68,7 @@ private:
CameraClass* m_Camera;
LightShaderClass* m_LightShader;
LightClass* m_Light;
+ LightClass* m_Lights;
LightMapShaderClass* m_LightMapShader;
MultiTextureShaderClass* m_MultiTextureShader;
AlphaMapShaderClass* m_AlphaMapShader;
@@ -82,6 +86,8 @@ private:
FpsClass* m_Fps;
TextClass* m_FpsString;
int m_previousFps;
+ NormalMapShaderClass* m_NormalMapShader;
+ SpecMapShaderClass* m_SpecMapShader;
ShaderManagerClass* m_ShaderManager;
ModelListClass* m_ModelList;
PositionClass* m_Position;
From d61a5b7f5f813069b56debebcf08e8690e67a1b3 Mon Sep 17 00:00:00 2001
From: GolfOcean334 <130740013+GolfOcean334@users.noreply.github.com>
Date: Sun, 7 Apr 2024 01:27:30 +0200
Subject: [PATCH 09/13] Minor: Ajout du Multitexturing dans le shader manager
Actuellement envie de DCD, JPP des Lights :angry:
---
enginecustom/applicationclass.cpp | 90 ++---
enginecustom/applicationclass.h | 2 -
enginecustom/enginecustom.vcxproj | 1 +
enginecustom/enginecustom.vcxproj.filters | 406 +++++-----------------
enginecustom/modelclass.cpp | 31 +-
enginecustom/modelclass.h | 4 +-
enginecustom/papier.tga | Bin 1044186 -> 0 bytes
enginecustom/spec02.tga | Bin 0 -> 1048620 bytes
8 files changed, 160 insertions(+), 374 deletions(-)
delete mode 100644 enginecustom/papier.tga
create mode 100644 enginecustom/spec02.tga
diff --git a/enginecustom/applicationclass.cpp b/enginecustom/applicationclass.cpp
index 563a6e1..aead749 100644
--- a/enginecustom/applicationclass.cpp
+++ b/enginecustom/applicationclass.cpp
@@ -4,7 +4,6 @@ ApplicationClass::ApplicationClass()
{
m_Direct3D = 0;
m_Camera = 0;
- m_MultiTextureShader = 0;
m_AlphaMapShader = 0;
m_Model = 0;
m_LightShader = 0;
@@ -48,7 +47,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
char mouseString1[32], mouseString2[32], mouseString3[32];
char testString1[32], testString2[32], testString3[32];
- char modelFilename[128], textureFilename1[128], textureFilename2[128], textureFilename3[128], renderString[32];
+ char modelFilename[128], textureFilename1[128], textureFilename2[128], textureFilename3[128], textureFilename4[128], textureFilename5[128], textureFilename6[128], renderString[32];
char bitmapFilename[128];
char spriteFilename[128];
char fpsString[32];
@@ -235,15 +234,6 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
return false;
}
- // Create and initialize the multitexture shader object.
- m_MultiTextureShader = new MultiTextureShaderClass;
-
- result = m_MultiTextureShader->Initialize(m_Direct3D->GetDevice(), hwnd);
- if (!result)
- {
- MessageBox(hwnd, L"Could not initialize the multitexture shader object.", L"Error", MB_OK);
- return false;
- }
// Set the file name of the model.
strcpy_s(modelFilename, "cube.txt");
@@ -251,13 +241,17 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
// Set the file name of the textures.
strcpy_s(textureFilename1, "stone01.tga");
strcpy_s(textureFilename2, "normal01.tga");
- strcpy_s(textureFilename3, "alpha01.tga");
+ strcpy_s(textureFilename3, "spec02.tga");
+ strcpy_s(textureFilename4, "alpha01.tga");
+ strcpy_s(textureFilename5, "light01.tga");
+ strcpy_s(textureFilename6, "moss01.tga");
// A FAIRE: Ajouter une nouvelle texture pour le multitexturing
// Create and initialize the model object.
m_Model = new ModelClass;
- result = m_Model->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3);
+ result = m_Model->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
+ textureFilename5, textureFilename6);
if (!result)
{
MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
@@ -321,6 +315,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
{
return false;
}
+
// Create and initialize the light map shader object.
m_LightMapShader = new LightMapShaderClass;
@@ -546,7 +541,7 @@ void ApplicationClass::Shutdown()
m_Sprite = 0;
}
- // Release the light objects.
+ // Release the lights objects.
if (m_Lights)
{
delete[] m_Lights;
@@ -592,46 +587,6 @@ void ApplicationClass::Shutdown()
m_Model = 0;
}
- // Release the multitexture shader object.
- if (m_MultiTextureShader)
- {
- m_MultiTextureShader->Shutdown();
- delete m_MultiTextureShader;
- m_MultiTextureShader = 0;
- // Release the bitmap object.
- if (m_Bitmap)
- {
- m_Bitmap->Shutdown();
- delete m_Bitmap;
- m_Bitmap = 0;
- }
-
- // Release the texture shader object.
- if (m_TextureShader)
- {
- m_TextureShader->Shutdown();
- delete m_TextureShader;
- m_TextureShader = 0;
- }
-
- // Release the camera object.
- if (m_Camera)
- {
- delete m_Camera;
- m_Camera = 0;
- }
-
- // Release the D3D object.
- if (m_Direct3D)
- {
- m_Direct3D->Shutdown();
- delete m_Direct3D;
- m_Direct3D = 0;
- }
-
- return;
- }
-
// Release the alpha map shader object.
if (m_AlphaMapShader)
{
@@ -1054,6 +1009,14 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
//// Render the model using the multitexture shader.
//m_Model->Render(m_Direct3D->GetDeviceContext());
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(0.0f, 4.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the texture shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
m_Model->GetTexture(0));
if (!result)
@@ -1063,7 +1026,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
// Setup matrices.
rotateMatrix = XMMatrixRotationY(rotation);
- translateMatrix = XMMatrixTranslation(-1.5f, -1.0f, 0.0f);
+ translateMatrix = XMMatrixTranslation(0.0f, 1.0f, 0.0f);
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
// Render the model using the light shader.
@@ -1078,7 +1041,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
// Setup matrices.
rotateMatrix = XMMatrixRotationY(rotation);
- translateMatrix = XMMatrixTranslation(1.5f, -1.0f, 0.0f);
+ translateMatrix = XMMatrixTranslation(0.0f, -2.0f, 0.0f);
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
// Render the model using the normal map shader.
@@ -1091,6 +1054,21 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
return false;
}
+ // Setup matrices.
+ rotateMatrix = XMMatrixRotationY(rotation);
+ translateMatrix = XMMatrixTranslation(0.0f, -5.0f, 0.0f);
+ worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
+
+ // Render the model using the Multitexture shader.
+ m_Model->Render(m_Direct3D->GetDeviceContext());
+
+ result = m_ShaderManager->RenderMultitextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
+ m_Model->GetTexture(0), m_Model->GetTexture(5));
+ if (!result)
+ {
+ return false;
+ }
+
// Lighting, utilise plusieurs lights donc Multiple Points Lighting
//result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
// diffuseColor, lightPosition);
diff --git a/enginecustom/applicationclass.h b/enginecustom/applicationclass.h
index 865123c..729cd0e 100644
--- a/enginecustom/applicationclass.h
+++ b/enginecustom/applicationclass.h
@@ -11,7 +11,6 @@
#include "lightshaderclass.h"
#include "lightclass.h"
#include "lightmapshaderclass.h"
-#include "multitextureshaderclass.h"
#include "alphamapshaderclass.h"
#include "bitmapclass.h"
#include "spriteclass.h"
@@ -70,7 +69,6 @@ private:
LightClass* m_Light;
LightClass* m_Lights;
LightMapShaderClass* m_LightMapShader;
- MultiTextureShaderClass* m_MultiTextureShader;
AlphaMapShaderClass* m_AlphaMapShader;
ModelClass* m_Model;
TextureShaderClass* m_TextureShader;
diff --git a/enginecustom/enginecustom.vcxproj b/enginecustom/enginecustom.vcxproj
index e520d7a..ab85b85 100644
--- a/enginecustom/enginecustom.vcxproj
+++ b/enginecustom/enginecustom.vcxproj
@@ -125,6 +125,7 @@
+
diff --git a/enginecustom/enginecustom.vcxproj.filters b/enginecustom/enginecustom.vcxproj.filters
index ad0862c..c30fa7f 100644
--- a/enginecustom/enginecustom.vcxproj.filters
+++ b/enginecustom/enginecustom.vcxproj.filters
@@ -1,323 +1,109 @@

-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {93995380-89BD-4b04-88EB-625FBE52EBFB}
- h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
-
-
- {b016e481-576e-4d99-bdde-34cc10c55b1d}
-
-
- {f76f9761-bbbe-42a8-935d-01f1b9172c38}
-
-
- {741e1efe-db9b-48a7-9ecb-4c34a696f40e}
-
-
- {51e14ebb-4f58-488f-8d0f-04935f51efda}
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
-
- Fichiers sources
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
-
- Fichiers d%27en-tête
-
+
+
+
+
+
+
+
+
+
+
-
- fonts
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
- fonts
-
-
- fonts
-
-
- shader
-
-
- shader
-
-
- shader
-
-
- texture
-
-
- texture
-
-
- texture
-
-
- texture
-
-
- shader
-
-
- shader
-
-
- shader
-
-
- texture
-
-
- texture
-
-
- shader
-
-
- shader
-
-
- shader
-
-
- shader
-
-
-
-
- fonts
-
-
- assets
-
-
- assets
-
-
- assets
-
-
- assets
-
-
-
-
- shader
-
-
- shader
-
+
+
+
+
+
\ No newline at end of file
diff --git a/enginecustom/modelclass.cpp b/enginecustom/modelclass.cpp
index 38dcfa7..c47f3b1 100644
--- a/enginecustom/modelclass.cpp
+++ b/enginecustom/modelclass.cpp
@@ -19,7 +19,8 @@ ModelClass::~ModelClass()
{
}
-bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* modelFilename, char* textureFilename1, char* textureFilename2, char* textureFilename3)
+bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* modelFilename, char* textureFilename1, char* textureFilename2, char* textureFilename3,
+ char* textureFilename4, char* textureFilename5, char* textureFilename6)
{
bool result;
@@ -40,7 +41,7 @@ bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCon
return false;
}
// Load the textures for this model.
- result = LoadTextures(device, deviceContext, textureFilename1, textureFilename2, textureFilename3);
+ result = LoadTextures(device, deviceContext, textureFilename1, textureFilename2, textureFilename3, textureFilename4, textureFilename5, textureFilename6);
if (!result)
{
return false;
@@ -206,13 +207,14 @@ void ModelClass::RenderBuffers(ID3D11DeviceContext* deviceContext)
}
-bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* filename1, char* filename2, char* filename3)
+bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* filename1, char* filename2, char* filename3, char* filename4, char* filename5,
+ char* filename6)
{
bool result;
// Create and initialize the texture object array.
- m_Textures = new TextureClass[3];
+ m_Textures = new TextureClass[6];
result = m_Textures[0].Initialize(device, deviceContext, filename1);
if (!result)
@@ -232,6 +234,24 @@ bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceC
return false;
}
+ result = m_Textures[3].Initialize(device, deviceContext, filename4);
+ if (!result)
+ {
+ return false;
+ }
+
+ result = m_Textures[4].Initialize(device, deviceContext, filename5);
+ if (!result)
+ {
+ return false;
+ }
+
+ result = m_Textures[5].Initialize(device, deviceContext, filename6);
+ if (!result)
+ {
+ return false;
+ }
+
return true;
}
@@ -244,6 +264,9 @@ void ModelClass::ReleaseTextures()
m_Textures[0].Shutdown();
m_Textures[1].Shutdown();
m_Textures[2].Shutdown();
+ m_Textures[3].Shutdown();
+ m_Textures[4].Shutdown();
+ m_Textures[5].Shutdown();
delete[] m_Textures;
m_Textures = 0;
diff --git a/enginecustom/modelclass.h b/enginecustom/modelclass.h
index 7116f9d..702c3a6 100644
--- a/enginecustom/modelclass.h
+++ b/enginecustom/modelclass.h
@@ -80,7 +80,7 @@ public:
ModelClass(const ModelClass&);
~ModelClass();
- bool Initialize(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*);
+ bool Initialize(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*, char*, char*, char*);
void Shutdown();
void Render(ID3D11DeviceContext*);
@@ -91,7 +91,7 @@ private:
bool InitializeBuffers(ID3D11Device*);
void ShutdownBuffers();
void RenderBuffers(ID3D11DeviceContext*);
- bool LoadTextures(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*);
+ bool LoadTextures(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*, char*, char*);
void ReleaseTextures();
bool LoadModel(char*);
diff --git a/enginecustom/papier.tga b/enginecustom/papier.tga
deleted file mode 100644
index 4f0b9b948c583c642d6ae39c98f2589eb80ab4c3..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001
literal 1044186
zcmc%SS(arva;0fjj-(!Id^Mw*OOY%_-+JFS;n6Y3AT!BFtMeVxU%4H5)!aNX$n>>j
z2_O&v0$__kF0NklzxkX0_BZ|afB(1t=l}RW|F7Tw=Id9#`}(U_zxm?xS6_bm$*ZqE
z`}8iWE0cZw`Dd@b`SOcbzy0dVSM>k!cfWo0&wu>GP5<98b`m%*hfBwfmzWSFx{o|{D{ii=Y6B)bpZEkCi);8lc
zW@S8`__qD;C|i$p;%u^(_JBRkEYkLp-StgZz4g?l-u{!(4HxxmFW;6Mr@5R-XB?(F
ztJ+SUJ>=O-1_Sm4uMO8`>}3CV$^Pl8|M}8I%73(P7v8_Qd;lp||LXFGFFyY0)n^}m
z@aoeK-hU?bFF*PC)z_ELAZ2>!^N&7!^~wA1z54jQcW-@lbhlr6pIzmTul7%`F}`@J
ze{|`ReSY=N50rGP-2Q7&u?G57v#^pZ24*i+c(M{hz*-!j8V$9QCr{^60ax`yU3<83mai=pmvM6X
z>yvLQyJNVx3sct~H#g3o`Kh>oqyK*8Bmd){|LNw%h}urRF-=?gVuP`rZE+{;!v*|=
zk?Q$C_ciRm7vIXi!Y9l{>lfiY-^BB^{2(l=YhRqJ8>2CsqjB|VJUaZQJE~l+xJI76
z&1LS}C$4$2u`&NE_@lKoZ}!BKw+Gg1J?hQ~Sxb9UezkGNSdG)Tc)FcMbEKnBGCD8<
zFWn2>4cW2d(Lbqi@$4~v=Nxa&M|^d540}@itY3T8ewmj)@QZvX9}yS3uPW!Ge78If
zM`8xw@19o9$F;qb$H~3qZ}K+0oNV(rK3IN-+jEq>HvP%$vo+?Q_Mu#@wc88r>lf`8
z9khOQ_J7`M{(8+Ph9P@(-X&yFZFJi!+}@JebK}t~PuiTOb2|B%%YC0b&V1RY3=`&8
zURs^CjV;B~a;{?Tna72py*HGNZQks*=5X0q=4qYEh6R%3qbM
zhfA1Cu1qhVZjIW*W-)5lo9~!ce>m6o`%*DwZ8D#FHnBU(r?k;Azcu6APq~=dI@m8R
zknj1?bw;qa=CK1Z$7(nu#2ic=WtgpwK<$z
zPW|goKlq>WHF?}pIa>YYZivqBzxwn!r&E8MJnqAHetG9{Uwr)fGXi{-$0@JB6`Qq-
z(Y4{Voqg!7Y<0D59#>h6xP5f;IB}vp?u=n)JzvLbQ|^uuFN#C3kS~Stu;NZY`B}Jw
zVfgHx$QQykzJ8&;cn_bepH6zV@s)16RNC`y_9S9n;+GbN7g6#kA92dgr{wiATIS
z{u(^HU*gU2$PO~?`W6?8(VboK0gu|Z9g{3ty~f}DS)0r!zQ9MgDPD$?Y-s$Kc=qg^
zFYU{B$s5DIZ0xKK7v%KV)7_b`
zd;=jzOywe#8-p?v%4#m$Y%*PM;=DQA1R935m0@-n&HuYUTIS3mmuzq|7}
z=ZBn|v;!%OCFfvcvvfHWqLAW_5UM4axKKjR$0rzWm^MomW|GEJreqF&kU?`%v?m
z&s@lu>W!Pfr}C)19Lqo{G&-91cK9VvHiomUu*ufK^q@;Gm&-b}s6ee~;J
z-tTa7Gw*WVxysvmi&K}|mCMofc1O2&xNzgl{<0NhL8oznh&f4FGx5k%vW3*?>vn`vPp*ClaXte%c08hHgP>FkJCPzK9+xlfe!ab8sHc=51qLxmCH4
zG0@ty@o(F+Hyii-vz?AU;bn8Ga<^o3?ihQm$@(JeMd3r)_;j-yf79B#AI{uu>(0Hn
z3GZSAU(H|dIC{zKdE{I=%axtBS9gZ6{n5Mc+;4KeOZ6@%hx^Gt{D1d%c;4!e{0+(L
z%H_IKHg*&zHXevU#U8vi^2*`^Y^U2j(RkMFe#7a&`1(VB@ix3zWSl5F^l$9=j+uSd
z9A%Gj*==81XLXzm?+hPdH2mUW+F6P_os&H7mp}gDtB>FL)pJf(9_QUn&h}k-oLsK_
z&AS>ZkCSut9qQ(9m3w2OL$|uOxbirB-{#IdP9E9!svo`ktLOK)@~-kY80BMlK35FJ
zi$mK^FL`}dmahKD`1uQN@A+?^@5BOiu_4);Vp?s*nYb~;hT>LnA{>Qr_dxF}mEk5V
zg)jIN--{FBI=;9i3+wUKGuGZ9gT;RHD-E^mwtPjUgP4$leMQY{}Rro
z_OHEo6MyL}^w~D&+}SIe$2!Hie1VT3K2rQEPP*HQ1^I5gTyFh*eP8)e-Y3qKua(D@
zvn9vnXOZ^aA+9O_!!#hKLQSt7~~%cosyQ#sY6JkA($9_z!c
zv3hrbHsiB}z1jZK`kT+^`u~3Yt|5&W*5=MD89(sW
zEH}H~d9FN84!3V}-hjLXA@6eP@;MlGrxZW%$}o1us$x@dqIQ^sO&I0-^wJHl*4`UZK#UXE}_TS&g{raare%1G?
za-#CMeUFpN^$sV$L*C=)-+c17&Ed-9HkaGCH949#xu5qq`pV|>oo?UlZl6ba+!vP}
z{yt6~_sRS3UUByI-zgVwVKcnuZ^doAm|ZN|xJ|!4$zK{vf4