Original Post
Hi.
In some scene demos I''ve looked at, they are using a kind of distortion effect.
Each scanline is moved either a few pixels to the left or a few pixels to the right(all scanlines using a randomized offset value for distortion).
I''ve tried to create this effect myself, but I can''t figure out how to get some speed out of it.
I''ve tried 2 different approches.
1:
--
What I do is that I render some 3D object to the backbuffer,
the use the GetBackBuffer from the D3DDevice object.
Then I get the memory surface pointer through the LockRect function. After that I loop through all scanlines and use the ''memcpy'' function to copy each scanline a random amount of pixels to the left.
However, this is extremly slow.
2:
--
Same way to get the backbuffer surface. But this time I was using the CopyRects function from the D3DDevice object to move the scanlines. Using arrays of RECTs and POINTs. Still very slow.
Any ideas anyone?