Jump to content
  • Advertisement
Sign in to follow this  
lpm_jacky

Is it Offscreen rendering?

This topic is 3258 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!