Surface and Texture

Started by
6 comments, last by GameDev.net 17 years, 7 months ago
A surface and a texture, is it like having two names for the same thing?? When do I use surface and when texture.
[ my blog ]
Advertisement
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.
Sirob Yes.» - status: Work-O-Rama.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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).
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.
Sirob Yes.» - status: Work-O-Rama.
Sure it does help, but have you got any sources that could confirm that ???
I'm very surprised ?!?
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. :)
Sirob Yes.» - status: Work-O-Rama.
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.

This topic is closed to new replies.

Advertisement