Jump to content

  • Log In with Google      Sign In   
  • Create Account


In Pixel shader


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 lomateron   Members   -  Reputation: 339

Like
0Likes
Like

Posted 02 September 2012 - 06:08 AM

Is there a way to know what are the values of the pixel i am gonna render to, inside the pixel shader( ) method, without using a shader resource or effect variable?

Sponsor:

#2 Jason Z   Crossbones+   -  Reputation: 4911

Like
0Likes
Like

Posted 02 September 2012 - 06:18 AM

Only if you are using the pixel shader with an unordered access view, and not in a render target view. Otherwise, the only way that the pixel value is read by the pipeline is in the output merger before it does the blending function. What type of algorithm are you trying to get set up?

#3 lomateron   Members   -  Reputation: 339

Like
0Likes
Like

Posted 02 September 2012 - 06:37 AM

in a 1D texture numObjects X 1, a pixel has the values that determine the position by time of the objecto only in one dimension,
so pixel.x =aceleration | pixel.y=velocity | pixel.z=initial position | pixel.z=mass
Then after some code of doing somethings... I have to modify those variables of an object(that means pixel), so i need to render to a pixel and know what are the values that that pixel had and another pixel of the texture too.

#4 Jason Z   Crossbones+   -  Reputation: 4911

Like
1Likes
Like

Posted 02 September 2012 - 03:45 PM

Have you considered keeping the data in a structured buffer, and using the compute shader to do the updating? That might make it easier to work with the data, instead of trying to fit it all to the paradigm of the pixel shader.

#5 JohnnyCode   Members   -  Reputation: 227

Like
0Likes
Like

Posted 03 September 2012 - 04:06 PM

textures are often source of data for pixel shaders but the general technique is to bind this data as a texture sampler of the shader that reads them, and generating this data to texture is done by offscreen render target shader in a less recent pass.
If you realy need to have rendering to a target behave on the target content right away, only option I can think of is stencil buffer, but that is rather restricted and in your case it wouldn't apply.




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