how to save pixel shader result to another texture?

Started by
12 comments, last by softimage 20 years, 3 months ago
quote:Original post by neneboricua19
It may be because of the flags used when the textures were created. Are you running the Debug Runtime? Is there any output to the debug spew? Have you checked the HRESULT values? Many times, the debug spew will tell you if an error or even if something strange is happening.

neneboricua


the debug messages include nothing special, and the return value is D3D_OK.

i noticed that in
StretchRect(m_renderTarget, NULL, m_renderResultSaved, NULL, D3DTEXF_NONE );

from GetDesc(), i can see that the two surfaces are of the same size, 592*466,which is equal to the
size of the client window.
the m_renderTarget is got by IDirect3DDevice9::GetRenderTarget(), not by CreateTexture.
even if i specify the 592*466 instead of NULL, i can only get
the left-upper part of renderTarget.
and at this place StretchRect works well stretching other textures.
Advertisement
What about the "renderResultSaved" variable? How was this one created? I ask because I''ve run into some issues with StretchRect depending on if a texture is created to be dynamic, or in a specific memory pool, etc...

neneboricua
quote:Original post by neneboricua19
What about the "renderResultSaved" variable? How was this one created? I ask because I''ve run into some issues with StretchRect depending on if a texture is created to be dynamic, or in a specific memory pool, etc...

neneboricua


GetDisplayMode(NULL, & dm );
CreateTexture(592, 466, 1, D3DUSAGE_RENDERTARGET, dm.Format,
D3DPOOL_DEFAULT , & m_renderResultT.p, NULL );
got the answer:

i copied the code from the sample vmr9allocator in DXSDK, which
change the u,v values of triangle points to be less than 1,
so i can see only a part of the texture i posted onto that
triangle.

sorry for making such a long thread.

This topic is closed to new replies.

Advertisement