Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Remeber state of pixel in HLSL.

4: Adsense

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   

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.

#2 Hornsj3   Members   

195
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   

50657
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   

536
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   

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.