Major update - Architecture Rework
This commit is contained in:
68
enginecustom/src/inc/shader/CelShadingShader.h
Normal file
68
enginecustom/src/inc/shader/CelShadingShader.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef _CELSHADINGSHADER_H_
|
||||
#define _CELSHADINGSHADER_H_
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: CelShadingShader
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class CelShadingShader
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
XMFLOAT3 lightPosition; // Add light position
|
||||
float padding2; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
float constantAttenuation;
|
||||
float linearAttenuation;
|
||||
float quadraticAttenuation;
|
||||
float padding3; // Padding to ensure the structure is a multiple of 16 bytes.
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
CelShadingShader();
|
||||
CelShadingShader(const CelShadingShader&);
|
||||
~CelShadingShader();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
};
|
||||
|
||||
#endif
|
57
enginecustom/src/inc/shader/Colorshaderclass.h
Normal file
57
enginecustom/src/inc/shader/Colorshaderclass.h
Normal file
@@ -0,0 +1,57 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: colorshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _COLORSHADERCLASS_H_
|
||||
#define _COLORSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: ColorShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class ColorShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
ColorShaderClass();
|
||||
ColorShaderClass(const ColorShaderClass&);
|
||||
~ColorShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
};
|
||||
|
||||
#endif
|
59
enginecustom/src/inc/shader/Multitextureshaderclass.h
Normal file
59
enginecustom/src/inc/shader/Multitextureshaderclass.h
Normal file
@@ -0,0 +1,59 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: multitextureshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _MULTITEXTURESHADERCLASS_H_
|
||||
#define _MULTITEXTURESHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: MultiTextureShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class MultiTextureShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
MultiTextureShaderClass();
|
||||
MultiTextureShaderClass(const MultiTextureShaderClass&);
|
||||
~MultiTextureShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
55
enginecustom/src/inc/shader/alphamapshaderclass.h
Normal file
55
enginecustom/src/inc/shader/alphamapshaderclass.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#ifndef _ALPHAMAPSHADERCLASS_H_
|
||||
#define _ALPHAMAPSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: AlphaMapShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class AlphaMapShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
AlphaMapShaderClass();
|
||||
AlphaMapShaderClass(const AlphaMapShaderClass&);
|
||||
~AlphaMapShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
};
|
||||
|
||||
#endif
|
62
enginecustom/src/inc/shader/fontshaderclass.h
Normal file
62
enginecustom/src/inc/shader/fontshaderclass.h
Normal file
@@ -0,0 +1,62 @@
|
||||
#ifndef _FONTSHADERCLASS_H_
|
||||
#define _FONTSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: FontShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class FontShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct PixelBufferType
|
||||
{
|
||||
XMFLOAT4 pixelColor;
|
||||
};
|
||||
|
||||
public:
|
||||
FontShaderClass();
|
||||
FontShaderClass(const FontShaderClass&);
|
||||
~FontShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_pixelBuffer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
57
enginecustom/src/inc/shader/lightmapshaderclass.h
Normal file
57
enginecustom/src/inc/shader/lightmapshaderclass.h
Normal file
@@ -0,0 +1,57 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTMAPSHADERCLASS_H_
|
||||
#define _LIGHTMAPSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: LightMapShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class LightMapShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
LightMapShaderClass();
|
||||
LightMapShaderClass(const LightMapShaderClass&);
|
||||
~LightMapShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
92
enginecustom/src/inc/shader/lightshaderclass.h
Normal file
92
enginecustom/src/inc/shader/lightshaderclass.h
Normal file
@@ -0,0 +1,92 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: lightshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _LIGHTSHADERCLASS_H_
|
||||
#define _LIGHTSHADERCLASS_H_
|
||||
#pragma once
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
/////////////
|
||||
const int NUM_LIGHTS = 4;
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: LightShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class LightShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding; // Added extra padding so structure is a multiple of 16 for CreateBuffer function requirements.
|
||||
float specularPower;
|
||||
XMFLOAT4 specularColor;
|
||||
};
|
||||
|
||||
struct LightColorBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
struct LightPositionBufferType
|
||||
{
|
||||
XMFLOAT4 lightPosition[NUM_LIGHTS];
|
||||
};
|
||||
|
||||
public:
|
||||
LightShaderClass();
|
||||
LightShaderClass(const LightShaderClass&);
|
||||
~LightShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
ID3D11Buffer* m_lightColorBuffer;
|
||||
ID3D11Buffer* m_lightPositionBuffer;
|
||||
};
|
||||
|
||||
#endif
|
1
enginecustom/src/inc/shader/lightshaderwaterclass.h
Normal file
1
enginecustom/src/inc/shader/lightshaderwaterclass.h
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
64
enginecustom/src/inc/shader/normalmapshaderclass.h
Normal file
64
enginecustom/src/inc/shader/normalmapshaderclass.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef _NORMALMAPSHADERCLASS_H_
|
||||
#define _NORMALMAPSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: NormalMapShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class NormalMapShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding;
|
||||
};
|
||||
|
||||
public:
|
||||
NormalMapShaderClass();
|
||||
NormalMapShaderClass(const NormalMapShaderClass&);
|
||||
~NormalMapShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
65
enginecustom/src/inc/shader/reflectionshaderclass.h
Normal file
65
enginecustom/src/inc/shader/reflectionshaderclass.h
Normal file
@@ -0,0 +1,65 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Filename: reflectionshaderclass.h
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _REFLECTIONSHADERCLASS_H_
|
||||
#define _REFLECTIONSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: ReflectionShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class ReflectionShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct ReflectionBufferType
|
||||
{
|
||||
XMMATRIX reflectionMatrix;
|
||||
};
|
||||
|
||||
public:
|
||||
ReflectionShaderClass();
|
||||
ReflectionShaderClass(const ReflectionShaderClass&);
|
||||
~ReflectionShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMMATRIX);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMMATRIX);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_reflectionBuffer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
72
enginecustom/src/inc/shader/refractionshaderclass.h
Normal file
72
enginecustom/src/inc/shader/refractionshaderclass.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#ifndef _REFRACTIONSHADERCLASS_H_
|
||||
#define _REFRACTIONSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: RefractionShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class RefractionShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT4 lightPosition;
|
||||
XMFLOAT3 lightDirection;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct ClipPlaneBufferType
|
||||
{
|
||||
XMFLOAT4 clipPlane;
|
||||
};
|
||||
|
||||
public:
|
||||
RefractionShaderClass();
|
||||
RefractionShaderClass(const RefractionShaderClass&);
|
||||
~RefractionShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
ID3D11Buffer* m_clipPlaneBuffer;
|
||||
};
|
||||
|
||||
#endif
|
63
enginecustom/src/inc/shader/shadermanagerclass.h
Normal file
63
enginecustom/src/inc/shader/shadermanagerclass.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#ifndef _SHADERMANAGERCLASS_H_
|
||||
#define _SHADERMANAGERCLASS_H_
|
||||
|
||||
// Inclure les en-t<>tes n<>cessaires
|
||||
#include <d3d11.h>
|
||||
#include <DirectXMath.h>
|
||||
#include <vector>
|
||||
#include "textureshaderclass.h"
|
||||
#include "normalmapshaderclass.h"
|
||||
#include "multitextureshaderclass.h"
|
||||
#include "translateshaderclass.h"
|
||||
#include "alphamapshaderclass.h"
|
||||
#include "specmapshaderclass.h"
|
||||
#include "transparentshaderclass.h"
|
||||
#include "lightshaderclass.h"
|
||||
#include "lightmapshaderclass.h"
|
||||
#include "refractionshaderclass.h"
|
||||
#include "watershaderclass.h"
|
||||
#include "celshadingshader.h"
|
||||
#include "sunlightshaderclass.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
class ShaderManagerClass
|
||||
{
|
||||
public:
|
||||
ShaderManagerClass();
|
||||
ShaderManagerClass(const ShaderManagerClass&);
|
||||
~ShaderManagerClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
|
||||
bool RenderTextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
bool RenderNormalMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
|
||||
bool RenderMultitextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderTranslateShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
bool RenderAlphaMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderSpecMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
|
||||
bool RenderTransparentShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
bool RenderlightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]);
|
||||
bool RenderlightMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
|
||||
bool RenderRefractionShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
bool RenderWaterShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
bool RenderCelShadingShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4, XMFLOAT3);
|
||||
bool RenderSunlightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
private:
|
||||
TextureShaderClass* m_TextureShader;
|
||||
NormalMapShaderClass* m_NormalMapShader;
|
||||
MultiTextureShaderClass* m_MultitextureShader;
|
||||
TranslateShaderClass* m_TranslateShader;
|
||||
AlphaMapShaderClass* m_AlphaMapShader;
|
||||
SpecMapShaderClass* m_SpecMapShader;
|
||||
TransparentShaderClass* m_TransparentShader;
|
||||
LightShaderClass* m_LightShader;
|
||||
LightMapShaderClass* m_LightMapShader;
|
||||
RefractionShaderClass* m_RefractionShader;
|
||||
WaterShaderClass* m_WaterShader;
|
||||
CelShadingShader* m_CelShadingShader;
|
||||
SunlightShaderClass* m_SunlightShader;
|
||||
};
|
||||
|
||||
#endif
|
72
enginecustom/src/inc/shader/specmapshaderclass.h
Normal file
72
enginecustom/src/inc/shader/specmapshaderclass.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#ifndef _SPECMAPSHADERCLASS_H_
|
||||
#define _SPECMAPSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: SpecMapShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class SpecMapShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct LightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT4 specularColor;
|
||||
float specularPower;
|
||||
XMFLOAT3 lightDirection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
public:
|
||||
SpecMapShaderClass();
|
||||
SpecMapShaderClass(const SpecMapShaderClass&);
|
||||
~SpecMapShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*,
|
||||
XMFLOAT3, XMFLOAT4, XMFLOAT3, XMFLOAT4, float);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_lightBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
};
|
||||
|
||||
#endif
|
68
enginecustom/src/inc/shader/sunlightshaderclass.h
Normal file
68
enginecustom/src/inc/shader/sunlightshaderclass.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#pragma once
|
||||
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
class SunlightShaderClass
|
||||
{
|
||||
|
||||
private :
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct CameraBufferType
|
||||
{
|
||||
XMFLOAT3 cameraPosition;
|
||||
float padding;
|
||||
};
|
||||
|
||||
struct SunLightBufferType
|
||||
{
|
||||
XMFLOAT4 diffuseColor;
|
||||
XMFLOAT4 ambientColor;
|
||||
XMFLOAT3 sunDirection;
|
||||
float intensity;
|
||||
};
|
||||
|
||||
struct SunLightColorBufferType
|
||||
{
|
||||
XMFLOAT4 sunColor;
|
||||
};
|
||||
|
||||
public :
|
||||
SunlightShaderClass();
|
||||
SunlightShaderClass(const SunlightShaderClass&);
|
||||
~SunlightShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3,float);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11Buffer* m_cameraBuffer;
|
||||
ID3D11Buffer* m_sunlightBuffer;
|
||||
ID3D11Buffer* m_sunlightColorBuffer;
|
||||
ID3D11Buffer* m_sunlightPositionBuffer;
|
||||
};
|
56
enginecustom/src/inc/shader/textureshaderclass.h
Normal file
56
enginecustom/src/inc/shader/textureshaderclass.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#ifndef _TEXTURESHADERCLASS_H_
|
||||
#define _TEXTURESHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: TextureShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class TextureShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
public:
|
||||
TextureShaderClass();
|
||||
TextureShaderClass(const TextureShaderClass&);
|
||||
~TextureShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
63
enginecustom/src/inc/shader/translateshaderclass.h
Normal file
63
enginecustom/src/inc/shader/translateshaderclass.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#ifndef _TRANSLATESHADERCLASS_H_
|
||||
#define _TRANSLATESHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: TranslateShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class TranslateShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct TranslateBufferType
|
||||
{
|
||||
float translation;
|
||||
XMFLOAT3 padding;
|
||||
};
|
||||
|
||||
public:
|
||||
TranslateShaderClass();
|
||||
TranslateShaderClass(const TranslateShaderClass&);
|
||||
~TranslateShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_translateBuffer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
63
enginecustom/src/inc/shader/transparentshaderclass.h
Normal file
63
enginecustom/src/inc/shader/transparentshaderclass.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#ifndef _TRANSPARENTSHADERCLASS_H_
|
||||
#define _TRANSPARENTSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include "Logger.h"
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: TransparentShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class TransparentShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct TransparentBufferType
|
||||
{
|
||||
float blendAmount;
|
||||
XMFLOAT3 padding;
|
||||
};
|
||||
|
||||
public:
|
||||
TransparentShaderClass();
|
||||
TransparentShaderClass(const TransparentShaderClass&);
|
||||
~TransparentShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, float);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_transparentBuffer;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
70
enginecustom/src/inc/shader/watershaderclass.h
Normal file
70
enginecustom/src/inc/shader/watershaderclass.h
Normal file
@@ -0,0 +1,70 @@
|
||||
#ifndef _WATERSHADERCLASS_H_
|
||||
#define _WATERSHADERCLASS_H_
|
||||
|
||||
|
||||
//////////////
|
||||
// INCLUDES //
|
||||
//////////////
|
||||
#include <d3d11.h>
|
||||
#include <d3dcompiler.h>
|
||||
#include <directxmath.h>
|
||||
#include <fstream>
|
||||
using namespace DirectX;
|
||||
using namespace std;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Class name: WaterShaderClass
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
class WaterShaderClass
|
||||
{
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
struct ReflectionBufferType
|
||||
{
|
||||
XMMATRIX reflection;
|
||||
};
|
||||
|
||||
struct WaterBufferType
|
||||
{
|
||||
float waterTranslation;
|
||||
float reflectRefractScale;
|
||||
XMFLOAT2 padding;
|
||||
};
|
||||
|
||||
public:
|
||||
WaterShaderClass();
|
||||
WaterShaderClass(const WaterShaderClass&);
|
||||
~WaterShaderClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, HWND);
|
||||
void Shutdown();
|
||||
bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
|
||||
private:
|
||||
bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void ShutdownShader();
|
||||
void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*,
|
||||
ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
void RenderShader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
ID3D11VertexShader* m_vertexShader;
|
||||
ID3D11PixelShader* m_pixelShader;
|
||||
ID3D11InputLayout* m_layout;
|
||||
ID3D11Buffer* m_matrixBuffer;
|
||||
ID3D11SamplerState* m_sampleState;
|
||||
ID3D11Buffer* m_reflectionBuffer;
|
||||
ID3D11Buffer* m_waterBuffer;
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user