Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
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

In Pixel shader

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 lomateron   Members   

491
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?

#2 Jason Z   Members   

6430
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   

491
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   Members   

6430
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   

1160
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.