// 렌더링 타겟 보존
m_pd3dDevice->GetRenderTarget(0, &pOldBackBuffer);
m_pd3dDevice->GetDepthStencilSurface(&pOldZBuffer);
m_pd3dDevice->GetViewport(&oldViewport);
m_pd3dDevice->EndScene(); // 함수 바깥에서 실행된 BeginScene 해제
// 렌더링 타겟 변경
m_pd3dDevice->SetRenderTarget(0, m_pShadowSurf);
m_pd3dDevice->SetDepthStencilSurface(m_pShadowTexZ);
D3DVIEWPORT9 viewport = {0,0, MAP_SIZE,MAP_SIZE,0.0f,1.0f};
m_pd3dDevice->SetViewport(&viewport);
행렬 설정 등등....
m_pd3dDevice->BeginScene();
메시를 그린다
m_pd3dDevice->EndScene();
// 렌더링 타겟 복구
m_pd3dDevice->SetRenderTarget(0, pOldBackBuffer);
m_pd3dDevice->SetDepthStencilSurface(pOldZBuffer);
m_pd3dDevice->SetViewport(&oldViewport);
pOldBackBuffer->Release();
pOldZBuffer->Release();
반응형
'그래픽스(Graphics) > DirectX9~12' 카테고리의 다른 글
이펙트 렌더링 g_pEffect->BeginPass(i) (0) | 2012.11.02 |
---|---|
SetRenderState 정리 (0) | 2012.11.02 |
DirectX 선그리기 (2) | 2012.11.02 |
DirectX code sampler 예제 [3D예제풀이1] : code sampler 예제 (0) | 2012.11.02 |
D3DPRESENT_INTERVAL_IMMEDIATE (0) | 2012.11.02 |