Revert "Minor - Start Shadow Map - V10.5.0"
This reverts commit d6b7626446.
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <d3d11.h>
|
||||
#include <DirectXMath.h>
|
||||
using namespace DirectX;
|
||||
|
||||
class depth_shader_class
|
||||
{
|
||||
public:
|
||||
depth_shader_class();
|
||||
~depth_shader_class();
|
||||
|
||||
bool initialize(ID3D11Device* device, HWND hwnd);
|
||||
void shutdown();
|
||||
bool render(ID3D11DeviceContext* deviceContext, int indexCount,
|
||||
XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix);
|
||||
|
||||
private:
|
||||
struct MatrixBufferType
|
||||
{
|
||||
XMMATRIX world;
|
||||
XMMATRIX view;
|
||||
XMMATRIX projection;
|
||||
};
|
||||
|
||||
bool initialize_shader(ID3D11Device* device, HWND hwnd, const WCHAR* vsFilename, const WCHAR* psFilename);
|
||||
void shutdown_shader();
|
||||
void output_shader_error_message(ID3D10Blob* errorMessage, HWND hwnd, const WCHAR* shaderFilename);
|
||||
bool set_shader_parameters(ID3D11DeviceContext* deviceContext,
|
||||
XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix);
|
||||
void render_shader(ID3D11DeviceContext* deviceContext, int indexCount);
|
||||
|
||||
ID3D11VertexShader* vertex_shader_;
|
||||
ID3D11PixelShader* pixel_shader_;
|
||||
ID3D11InputLayout* layout_;
|
||||
ID3D11Buffer* matrix_buffer_;
|
||||
};
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "celshade_class.h"
|
||||
#include "skybox_shader_class.h"
|
||||
#include "sunlight_shader_class.h"
|
||||
#include "depth_shader_class.h"
|
||||
|
||||
using namespace DirectX;
|
||||
|
||||
@@ -45,10 +44,8 @@ public:
|
||||
bool render_refraction_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[], XMFLOAT4);
|
||||
bool render_water_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, float, float);
|
||||
bool render_cel_shading_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
bool render_sunlight_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float, ID3D11ShaderResourceView
|
||||
* shadowMap, XMMATRIX lightViewMatrix, XMMATRIX lightProjectionMatrix);
|
||||
bool render_sunlight_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
bool render_skybox_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
bool render_depth_shader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX);
|
||||
|
||||
private:
|
||||
texture_shader_class* texture_shader_;
|
||||
@@ -65,7 +62,6 @@ private:
|
||||
celshade_class* cel_shading_shader_;
|
||||
sunlight_shader_class* sunlight_shader_;
|
||||
skybox_shader_class* skybox_shader_;
|
||||
depth_shader_class* depth_shader_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -38,12 +38,6 @@ private :
|
||||
XMFLOAT4 sun_color;
|
||||
};
|
||||
|
||||
struct light_view_matrix_buffer_type
|
||||
{
|
||||
XMMATRIX light_view;
|
||||
XMMATRIX light_projection;
|
||||
};
|
||||
|
||||
public :
|
||||
sunlight_shader_class();
|
||||
sunlight_shader_class(const sunlight_shader_class&);
|
||||
@@ -51,29 +45,14 @@ public :
|
||||
|
||||
bool initialize(ID3D11Device*, HWND);
|
||||
void shutdown();
|
||||
bool render(
|
||||
ID3D11DeviceContext* device_context,
|
||||
int index_count,
|
||||
XMMATRIX world_matrix,
|
||||
XMMATRIX view_matrix,
|
||||
XMMATRIX projection_matrix,
|
||||
ID3D11ShaderResourceView* texture,
|
||||
XMFLOAT4 diffuse_color,
|
||||
XMFLOAT4 ambient_color,
|
||||
XMFLOAT3 sun_direction,
|
||||
float sun_intensity,
|
||||
ID3D11ShaderResourceView* shadow_map,
|
||||
XMMATRIX light_view_matrix,
|
||||
XMMATRIX light_projection_matrix
|
||||
);
|
||||
bool render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3,float);
|
||||
|
||||
private:
|
||||
bool initialize_shader(ID3D11Device*, HWND, WCHAR*, WCHAR*);
|
||||
void shutdown_shader();
|
||||
void output_shader_error_message(ID3D10Blob*, HWND, WCHAR*);
|
||||
|
||||
bool set_shader_parameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float, ID3D11ShaderResourceView
|
||||
* shadowMap, XMMATRIX lightViewMatrix, XMMATRIX lightProjectionMatrix);
|
||||
bool set_shader_parameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float);
|
||||
void render_shader(ID3D11DeviceContext*, int);
|
||||
|
||||
private:
|
||||
@@ -86,7 +65,4 @@ private:
|
||||
ID3D11Buffer* sunlight_buffer_;
|
||||
ID3D11Buffer* sunlight_color_buffer_;
|
||||
ID3D11Buffer* sunlight_position_buffer_;
|
||||
ID3D11Buffer* light_view_matrix_buffer_;
|
||||
ID3D11ShaderResourceView* shadow_map_texture_;
|
||||
ID3D11SamplerState* shadow_sampler_state_;
|
||||
};
|
||||
@@ -43,8 +43,6 @@
|
||||
#include <DirectXMath.h>
|
||||
#include <mutex>
|
||||
|
||||
#include "shadow_map.h"
|
||||
|
||||
|
||||
/////////////
|
||||
// GLOBALS //
|
||||
@@ -187,17 +185,8 @@ private:
|
||||
bool render_scene_to_texture(float);
|
||||
bool render_refraction_to_texture();
|
||||
bool render_reflection_to_texture();
|
||||
bool render_pass(
|
||||
const std::vector<std::reference_wrapper<std::vector<object*>>>& RenderQueues,
|
||||
XMFLOAT4* diffuse,
|
||||
XMFLOAT4* position,
|
||||
XMFLOAT4* ambient,
|
||||
XMMATRIX view,
|
||||
XMMATRIX projection
|
||||
);
|
||||
bool create_shadow_map(
|
||||
const std::vector<std::reference_wrapper<std::vector<object*>>>& RenderQueues
|
||||
);
|
||||
bool render_pass(const std::vector<std::reference_wrapper<std::vector<object*>>>& RenderQueues, XMFLOAT4* diffuse, XMFLOAT4* position, XMFLOAT4* ambient, XMMATRIX view, XMMATRIX projection);
|
||||
|
||||
void update_skybox_position();
|
||||
|
||||
public :
|
||||
@@ -331,18 +320,6 @@ private :
|
||||
// ------------------------------------------------- //
|
||||
|
||||
input inputs_;
|
||||
|
||||
// ------------------------------------------------- //
|
||||
// -------------------- Shadows -------------------- //
|
||||
// ------------------------------------------------- //
|
||||
|
||||
shadow_map* shadow_map_;
|
||||
camera_class* light_camera_;
|
||||
XMFLOAT4 light_position_buffer_;
|
||||
XMFLOAT3 light_rotation_buffer_;
|
||||
XMMATRIX light_view_matrix_;
|
||||
XMMATRIX light_projection_matrix_;
|
||||
ID3D11ShaderResourceView* shadow_srv_;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,33 +0,0 @@
|
||||
#pragma once
|
||||
#include <d3d11.h>
|
||||
|
||||
class shadow_map
|
||||
{
|
||||
public:
|
||||
|
||||
shadow_map();
|
||||
shadow_map(const shadow_map&) = delete;
|
||||
shadow_map& operator=(const shadow_map&) = delete;
|
||||
~shadow_map();
|
||||
|
||||
bool initialize(
|
||||
ID3D11Device* device,
|
||||
int shadow_map_width,
|
||||
int shadow_map_height
|
||||
);
|
||||
|
||||
void set_render_target(ID3D11DeviceContext* context);
|
||||
void clear_render_target(ID3D11DeviceContext* context, float depth);
|
||||
|
||||
ID3D11ShaderResourceView* get_shader_resource_view() const;
|
||||
|
||||
void shutdown();
|
||||
|
||||
private:
|
||||
ID3D11Texture2D* depth_texture_;
|
||||
ID3D11DepthStencilView* depth_stencil_view_;
|
||||
ID3D11ShaderResourceView* shader_resource_view_;
|
||||
D3D11_VIEWPORT viewport_;
|
||||
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user