Render targets w/ different dimensions than Back Buffer DX11
Hi, I'm trying to do some image processing type stuff (Gaussian blur) on some 1024x1024 textures, but my back buffer is 800x600. I'm not sure what the rules are on how to do this, so at the moment I either get distorted textures or render targets that clear, but don't get drawn to. Can someone give me a step-by-step process of how to do this? I've read that all active render targets have to be the same type and dimensions, but I feel like I'm missing something.
If you're using MRT then all render targets *bound to the context* need to be the same dimensions, but that isn't a global 'if you EVER don't send the same dimensions to CreateRenderTargetView() then D3D gonna asplode.' Based on what you're trying to do, you should easily be able to create a simple 1024x1024 target and bind/work with that directly.
If that's what you *are* doing, then it sounds like some code is in order.
If that's what you *are* doing, then it sounds like some code is in order.
To me it sounds like he's using a swap chain and rendering things to screen, hence the mentioned back buffer. Forget about screen and rendering to it, Icetigris, you're going to render to "virtual" "frame buffers" (render targets), which have nothing to do with your window (it doesn't even have to exist).
Just create a texture (ID3D11Device::CreateTexture2D), create a RTV for this texture (ID3D11Device::CreateRenderTargetView), set the RTV (ID3D11DeviceContext::OMSetRenderTargets), apply your shader, set some SRVs (shader resources, source textures...) and issue a draw call (typically a 4 vertex quad). Your card will render into your custom texture (instead of screen).
Just create a texture (ID3D11Device::CreateTexture2D), create a RTV for this texture (ID3D11Device::CreateRenderTargetView), set the RTV (ID3D11DeviceContext::OMSetRenderTargets), apply your shader, set some SRVs (shader resources, source textures...) and issue a draw call (typically a 4 vertex quad). Your card will render into your custom texture (instead of screen).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement