Jump to content
  • Advertisement
Sign in to follow this  
LemonLime

Rendering to a texture...

This topic is 4723 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, I need to render to a texture, that will also be rendered. From what I can gather from the help, it is only possible to render to a surface, and a surface cannot be used as a texture.
IDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex,IDirect3DSurface9 *pRenderTarget);

IDirect3DDevice9::SetTexture(DWORD Sampler,IDirect3DBaseTexture9 *pTexture);
Do I need to copy the surface to a texture (although this would be slow), or is there another way? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
Basically just create a texture with a supported surface format and then call surface = texture.GetSurfaceLevel(0); to get the surface and use it with device.SetRenderTarget(0, surface); (you might also want to set a new depth stencil surface in case you don't want your original overwritten or use bigger texture sizes).

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!