Render rendertargets.
Before you set your render targets you want to call this function http://msdn.microsoft.com/en-us/library/windows/desktop/ff476460%28v=vs.85%29.aspx and once you are done rendering to these targets you call OMSetRenderTargets again and pass it the information the function call in the link gives you.
When you want to use the rendertargets as a texture to read from you need to unbind the rendertargetviews for them and reset this to the actual backbuffer the one you want to show on screen.
Before you set your render targets you want to call this function http://msdn.microsoft.com/en-us/library/windows/desktop/ff476460%28v=vs.85%29.aspx and once you are done rendering to these targets you call OMSetRenderTargets again and pass it the information the function call in the link gives you.
I manged to get it work and but even better i full understand it want im doing as well Thx so much for you help NightCreature83.
I havent got the GetRenderTargets -> SetRenderTargets to work, think i need to do some reading about ** to * i guess. But thx again for you help!
void function(int** var);
//This is then called as this
int* anotherVar;
function(&anotherVar);
HI again, sorry for this NightCreateure83 (or anyone else :) just one more thing.
I got it to work as i wrote before, but im getting some warnings that i would like to get ride off. I gueesing im not resting the them correctly or that im doing it in the wrong order.
void PipelineManagerDX11::SetRenderTargetView(TArray<ID3D11RenderTargetView*> renderTargets,ID3D11DepthStencilView* pDepthStencilView)
{
m_RenderTargets = renderTargets;
m_pDepthStencilView = pDepthStencilView;
UINT nViews = m_RenderTargets.count();
ID3D11RenderTargetView* rtvs[2];
for (UINT i= 0; i<nViews;++i){
rtvs = m_RenderTargets;
}
m_pContext->OMSetRenderTargets(nViews,rtvs,m_pDepthStencilView);
}
2) Render the scene
3) Resting the Rendertarget, setting Rendertarget 2 to null so i can use the the texture and Setting render target 1 to the device.
ID3D11RenderTargetView* rTargets[2] = {m_RenderTargets[0], NULL };
m_pContext->OMSetRenderTargets(2, rTargets, NULL);
4) rendering the quad with Shaderview bound to the texture that Rendertarget 2 is using.
m_pContext->PSSetShaderResources(0, 1, &m_pShaderResourceView);
m_pContext->VSSetShader(m_pVertexShader, NULL, 0 );
m_pContext->PSSetShader(m_pPixelShader, NULL, 0);
m_pContext->DrawIndexed(m_QuadIB->m_numIndices,0,0);
5) Setting all the rendertargets as i did in step one.
SetRenderTargetView(m_RenderTargets,m_pDepthStencilView);
6) Ending the pipeline with the usual stuff, clearing all the renderingtargets, swaping the backbufffer, present etc.
Thats an easy fix just put a & in front of the variable you are passing to getRenderTargets, as like this (pseudo code for your problem)
void function(int** var); //This is then called as this int* anotherVar; function(&anotherVar);