Render in a texture using itself as a texture?

Render in a texture using itself as a texture?

Post by mathieu_gd » Fri, 28 Dec 2007 23:32:19


Dear all,

I am doing image processing using directx 9 (managed)

Here is my (very simplified) problem :
I am using a render target surface.

I have to perform a geometric tranformation on this surface.
For this transformation, the entry is the surface, and the output is
the same surface.
Let's say it is a translation (for simplifying my problem) : My
texture has to be scrolled itself by 10 pixels up.

The naive way would be to blit a quad to my render target texture,
using as source texture the render target texture itself.
It looks it does not work at all...

Is it possible to do it without involving an extra render target
texture, as a buffer?

Thanks in advance,
-Mathieu
 
 
 

Render in a texture using itself as a texture?

Post by legalize+j » Sat, 29 Dec 2007 04:48:23

[Please do not mail me a copy of your followup]

You can't use a texture as a source and as a target at the same time.

You can ping-pong between two textures, however.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
< http://www.yqcomputer.com/ ~legalize/book/download/index.html>

Legalize *** hood! < http://www.yqcomputer.com/ ;