   DirectX surface to texture
  Hello,i have problem with getting texture from surface, which i need for shader.my code looks like this:variables with t_ prefix are empty textures.variables with s_ prefix are filled surfaces.LPDIRECT3DSURFACE9 color_surface,normal_surface,depth_surface;t_ColorTexture->GetSurfaceLevel(0, &color_surface);t_NormalTexture->GetSurfaceLevel(0, &normal_surface);t_DepthTexture->GetSurfaceLevel(0, &depth_surface);D3DXLoadSurfaceFromSurface( color_surface, NULL, NULL, s_ColorTexture, NULL,NULL, D3DTEXF_NONE, NULL );D3DXLoadSurfaceFromSurface( normal_surface, NULL, NULL, s_NormalTexture, NULL,NULL, D3DTEXF_NONE, NULL );D3DXLoadSurfaceFromSurface( depth_surface, NULL, NULL, s_DepthTexture, NULL,NULL, D3DTEXF_NONE, NULL );Surfaces comes from RenderTarget. Problem is :) nothing is stored in textures, what i should do for it ?Thank you very much.   
  What do the Debug Runtimes say the problem is? Is there a reason you can't use the top level surface of your textures instead of the s_* surfaces?   ;  "Is there a reason you can't use the top level surface of your textures instead of the s_* surfaces?"You mean .. Create texture, Get its surface and use it for rendertarget ? this is possible ?i didn't know about that i can make it this way, hehe   ;Quote:Original post by wh1sp3rik"Is there a reason you can't use the top level surface of your textures instead of the s_* surfaces?"You mean .. Create texture, Get its surface and use it for rendertarget ? this is possible ?i didn't know about that i can make it this way, heheYup, that's why CreateTexture allows you to specify D3DUSAGE_RENDERTARGET.   ;  That's great, thank youi was using CreateRenderTarget function.   