PixelShader -> Pixel Movement

Started by
2 comments, last by xprzemos 11 years, 9 months ago
Hello. i'm new on DirectX programming and i have small problem.
I want move down many pixel on GPU. My target platform is Windows8 x86 and arm so i choose Direct 11.1.
I have implemented basic pixel shader and can render it on GPU XNA but Win* not have XNA:P. Idea is simple :


1 Swap render target (first, second),
2. Draw scene with shader
3. Set basic render target (default)
4. Draw render target (first, second)



and thats way my pixel can move (i check in shader neighbours and replace color). My question is how the best way put in to DirectX.
I read a lot, check many tutorial and i'm little confused :)

First Way : I know it can be made by RenderTargetView and ShaderResource (i can draw to render target, put it to shader but i can't draw result target it to default render target :/ (in XNA is simple couse i can draw RenderTarget as texture)).

Second Way : I can render it in default render target, put in to shader and later get result from backbuffer () and repeat operation (put to shader)

Couse my hardware target is DirectX10 i can't use compute shaders.

And here is my question, what way is the best by performance profile, maybe is some others way and i'm wrong thinking about it.
If you know some tutorial or suggestion is a very helpfull for me.
Really thanks for help and sorry for bad english.
Advertisement
Moving pixels?
What are you actualy trying to achive?

Are you refering to simple transformation? etc, to get a cube to rotate

i honestly dont understand your question realy...
"There will be major features. none to be thought of yet"
I think xprzemos mean's rendering a texture, and then rendering another texture as a procedural evolution of the first, say as cellular automata might use the previous texture as input to it's next state. Is that what you mean ? I could be way off.

If that's what you mean, you can sample / load in the shader from your texture / rendertarget just as you do in XNA. I wouldn't worry about performance until you can actually execute the method then come back with performance stats and ask why it's slow. I think you already have the right idea anyway. Let us know how it goes.
Exacly, main idea is a specyfic type of cellular automata.
Really thanks for answer

This topic is closed to new replies.

Advertisement