Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm slightly confused about textures versus surfaces in Direct3D9. Now, it seems fairly simple that you can only read from a texture and only write to a surface, and when you create a texture then you can get surfaces to set as render targets from it.

What I don't quite get is the CreateTexture function. It's CreateRenderTarget equivalent for a surface which is only rendered to and never read has the options of anti-aliasing parameters, whereas CreateTexture doesn't, even though you can explicitly use it to create render targets.

Does that mean that it is impossible to create an intermediate texture for e.g. shadow mapping which has anti-aliasing?

share|improve this question
Just answered a closely-related question about this here: [How do i: convert surface to a texture or create a texture with certain multisampling parameters or render a surface with an alpha layer][1] [1]:… – user39876 Dec 13 '13 at 6:58
up vote 1 down vote accepted

I'm fairly sure you cannot read an MSAA (antialiased) render target directly as a texture in D3D9. (You can do that in D3D10-11, I believe). In D3D9, you must "resolve" an MSAA render target by copying it to a non-MSAA render target using StretchRect. This results in a plain image with the antialiasing baked in, which you can then use as a texture.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.