Sign in to follow this  

Surface and Texture

This topic is 4110 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

Surfaces are just 2D areas of memory that are used to store images. A texture is an interface that contains one or more surfaces, and is used as input when rendering.

A simple texture would normally have one surface, containing the image data. However, if MIP Mapping is used, the texture has a chain of surfaces, one for each MIP map. Likewise, Volume Textures, and Cube Textures have more than surface.

Normally, a texture is used for almost everything used in modern graphics. The most common exception is the backbuffer, which is only a surface, since it is only drawn to, and is never used to draw onto something else. Other than that, in most likelyhood, any other surface will be used to draw onto the backbuffer, or onto some other surface, so you'd usually want to have those surfaces as a part of a texture.

Hope this helps.

Share this post


Link to post
Share on other sites
Surfaces can't be bound to samplers - that is, you can't map them over the surface of a triangle (or other 3D geometry). You need to use an IDirect3DTexture9 if you want to do this. Using a IDirect3DSurface9 can be rendered to the back buffer but you're much more limited in what you can do and it is almost certainly going to be slower.

Just use textures [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Hello, I have a big question about this, if anybondy could help me...

I am using a pixel shader that is outputting into 2 render targets.
First one is normal FORMAT and second one is only a D3DFMT_R32F.

To create those render target I have first created texture and then use GetSurfaceLevel() to retreive the surface.

That is wokring fine in normal circonstency.

Now... I need to use D3DMULTISAMPLE_4_SAMPLES as well.
My question is then: how to create the surface accordingly with CreateRenderTarget() I suppose and then have a texture bound to it so I can use it after ?

Because creating a texture and then using GetSurfaceLevel() won't give me the D3DMULTISAMPLE_4_SAMPLES state.
Or is there a way to then modify the surface so it will be using the same states as the backbuffer (wich is using D3DMULTISAMPLE_4_SAMPLES).

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Now... I need to use D3DMULTISAMPLE_4_SAMPLES as well.

Multi-Sampling and Multiple Render Targets (MRTs) cannot be used at the same time. It just isn't supported.

Hope this helps.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sure it does help, but have you got any sources that could confirm that ???
I'm very surprised ?!?

Share this post


Link to post
Share on other sites
Of course, its in the DX SDK Documentation.

Quote:
Taken from here
Multiple render targets have the following restrictions:
*** snip ***
* No antialiasing is supported.


Yes, it is just a small note in some big list, but enabling MRTs should turn off anti-aliasing.

Hope this helps. :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Many thx, I have really appreciate.
Unfortunatly I have a big work to do now to split into another rendering pass
:( :( :(
not talking about the impact on the frame rate...

Many thx again.

Share this post


Link to post
Share on other sites

This topic is 4110 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.

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