Minor - Start Shadow Map - V10.5.0

This commit is contained in:
2025-05-22 17:28:29 +02:00
parent f9d4523f09
commit d6b7626446
18 changed files with 1305 additions and 531 deletions

View File

@@ -38,6 +38,12 @@ 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&);
@@ -45,14 +51,29 @@ public :
bool initialize(ID3D11Device*, HWND);
void shutdown();
bool render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3,float);
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
);
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);
bool set_shader_parameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4, XMFLOAT4, XMFLOAT3, float, ID3D11ShaderResourceView
* shadowMap, XMMATRIX lightViewMatrix, XMMATRIX lightProjectionMatrix);
void render_shader(ID3D11DeviceContext*, int);
private:
@@ -65,4 +86,7 @@ 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_;
};