Hi guys,
right now I'm trying to follow a tutorial from raster tek, tutorial 22 about Render To Texture: http://www.rastertek.com/dx11tut22.html , but stuff isn't going as well as i thought because this pops up:
D3D11: ERROR: ID3D11DeviceContext::OMSetRenderTargets: The RenderTargetView at slot 0 is not compatable with the DepthStencilView. DepthStencilViews may only be used with RenderTargetViews if the effective dimensions of the Views are equal, as well as the Resource types, multisample count, and multisample quality. The RenderTargetView at slot 0 has (w:800,h:600,as:1), while the Resource is a Texture2D with (mc:1,mq:0). The DepthStencilView has (w:800,h:600,as:1), while the Resource is a Texture2D with (mc:4,mq:0). D3D11_RESOURCE_MISC_TEXTURECUBE factors into the Resource type, unless GetFeatureLevel() returns D3D_FEATURE_LEVEL_10_1 or greater. [ STATE_SETTING ERROR #388: OMSETRENDERTARGETS_INVALIDVIEW ]
So as I understand, theres something wrong with my Texture2D, now some code:
For the render to texture class: (textureWidth debugged 800, textureHeight debugged 600)
// Setup the render target texture description.
textureDesc.Width = textureWidth;
textureDesc.Height = textureHeight;
textureDesc.MipLevels = 1;
textureDesc.ArraySize = 1;
textureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT;
textureDesc.SampleDesc.Count = 1;
textureDesc.Usage = D3D11_USAGE_DEFAULT;
textureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE;
textureDesc.CPUAccessFlags = 0;
textureDesc.MiscFlags = 0;
In the system class (the default texture) (sw debugged 800, sh debugged 600)
texd.Width = sw;
texd.Height = sh;
texd.ArraySize = 1;
texd.MipLevels = 1;
texd.SampleDesc.Count = 4;
texd.Format = DXGI_FORMAT_D32_FLOAT;
texd.BindFlags = D3D11_BIND_DEPTH_STENCIL;
Now I've never touched Render To Texture before this, so if you wan't more information, please tell me.
Thank You