Jump to content

  • Log In with Google      Sign In   
  • Create Account

Remeber state of pixel in HLSL.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 xprzemos   Members   -  Reputation: 116

Like
0Likes
Like

Posted 16 July 2012 - 01:42 AM

Hello, i have a little problem and i wanna know it's a good way to resolve it.
I change many pixel color on my application (cellular automata),
I swap render targets to get actual back-buffer and later i put it to my Pixel-shader, in next frame operation is repeat.
My problem i when wanna know the pixel is changed or not.

I know i can solve it by use one more render target and remember my specific data per pixel, but i think it can be made some performance issue. Maybe is some other way to do it. I use DirectX10.

Really thanks for help.

Sponsor:

#2 Hornsj3   Members   -  Reputation: 191

Like
1Likes
Like

Posted 16 July 2012 - 04:47 AM

Hmm if you said DX11 I would say use an unordered access view (UAV) and use it as a RWTexture2D in your pixel shader. It looks like those are only available in the compute shader for DX10.

#3 Hodgman   Moderators   -  Reputation: 31800

Like
1Likes
Like

Posted 16 July 2012 - 04:55 AM

Yes, the standard solution would be to allocate an 'extra' render target.

#4 mancubit   Members   -  Reputation: 518

Like
1Likes
Like

Posted 16 July 2012 - 04:57 AM

guess you could also solve it via stencil buffer. If pixel does not change, clip it, otherwise write one (or something else) in there. You can then use the stencil buffer to mask out only the changed/unchanged pixels.

#5 xprzemos   Members   -  Reputation: 116

Like
1Likes
Like

Posted 16 July 2012 - 07:53 AM

Really thanks everyone ,Hornsj3 yes i know it about DX11 but i write it to Windows 8 and tablets with Windows 8 have minimal hardware version DX10 so i must choose it if i want target to many people. Compute Shader is available from DirectX 10.1 :(

Edited by xprzemos, 16 July 2012 - 07:55 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS