Sign in to follow this  
xprzemos

PixelShader -> Pixel Movement

Recommended Posts

xprzemos    116
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.

Share this post


Link to post
Share on other sites
Tordin    625
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...

Share this post


Link to post
Share on other sites
Gavin Williams    985
I think [url="http://www.gamedev.net/user/200492-xprzemos/"]xprzemos[/url] 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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this