Sign in to follow this  
lpm_jacky

Is it Offscreen rendering?

Recommended Posts

Hi, First, I create a rendertaget for offscreen rendering, i.e. IDirect3DTexture9* pTexture; IDirect3DSurface9* pSurface_BackBuffer; IDirect3DSurface9* pSurface_Render; width = 256; height = 256; Levels = 1; Usage = D3DUSAGE_RENDERTARGET; Format= D3DFMT_A32B32G32R32F; Pool = D3DPOOL_DEFAULT; pSharedHandle = 0; device->CreateTexture(Width, Height, Levels, Usage, Format, Pool, &pTexture, pSharedHandle); ... Then, do rendering like this ID3DXEffect *effect; // assume initialized g_Device->GetRenderTarget(0,&pSurface_BackBuffer); pTexture->GetSurfaceLevel(0,&pSurface_Render); g_Device->SetRenderTarget(0,pSurface_Render); g_Device->BeginScene(); UINT n; effect->Begin(&n, 0); effect->BeginPass(0); // render something effect->EndPass(); effect->End(); g_Device->SetRenderTarget(0,pSurface_BackBuffer); And then, do the normal rendering. If I do it in this way, is it doing offscreen rendering of render target? If not, what functions do I need to call for offscreen rendering of render target? Thank you. Jacky

Share this post


Link to post
Share on other sites
The term 'off-screen rendering' just means that you aren't rendering into the backbuffer - so yes, I think what you are doing qualifies. However, what are you using the offscreen buffer for? As an input to some other rendering pass?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this