Shadows go brrr
This commit is contained in:
@@ -7,13 +7,15 @@ SamplerState::SamplerState(ID3D11Device *device)
|
||||
SamplerState::~SamplerState() {
|
||||
if (m_samplerState) m_samplerState->Release();
|
||||
}
|
||||
|
||||
bool SamplerState::Initialize() {
|
||||
D3D11_SAMPLER_DESC samplerDesc = {};
|
||||
samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
|
||||
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
// samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
// samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
// samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
|
||||
samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP;
|
||||
samplerDesc.ComparisonFunc = D3D11_COMPARISON_LESS_EQUAL;
|
||||
samplerDesc.MinLOD = 0;
|
||||
samplerDesc.MaxLOD = D3D11_FLOAT32_MAX;
|
||||
|
||||
@@ -9,9 +9,9 @@ public:
|
||||
SamplerState(ID3D11Device* device);
|
||||
~SamplerState();
|
||||
|
||||
|
||||
bool Initialize();
|
||||
ID3D11SamplerState* GetSamplerState() const { return m_samplerState; }
|
||||
|
||||
private:
|
||||
ID3D11Device* m_device;
|
||||
ID3D11SamplerState* m_samplerState;
|
||||
|
||||
@@ -40,6 +40,7 @@ void ShadowMapBuffer::SetRenderTarget(ID3D11DeviceContext *deviceContext) {
|
||||
deviceContext->OMSetRenderTargets(0, nullptr, m_depthBuffer.GetDepthStencilView());
|
||||
}
|
||||
|
||||
|
||||
void ShadowMapBuffer::ResetRenderTarget(ID3D11DeviceContext *deviceContext) {
|
||||
ID3D11RenderTargetView *nullRTV = nullptr;
|
||||
deviceContext->OMSetRenderTargets(1, &nullRTV, nullptr);
|
||||
|
||||
@@ -27,9 +27,7 @@ public:
|
||||
|
||||
ID3D11SamplerState *GetSamplerState() const { return m_samplerState.GetSamplerState(); }
|
||||
|
||||
|
||||
ID3D11DepthStencilView *GetDepthStencilView();
|
||||
|
||||
private:
|
||||
ID3D11Device *m_device;
|
||||
UINT m_width;
|
||||
|
||||
Reference in New Issue
Block a user