Jump to content
  • Advertisement
Sign in to follow this  
winw

How can I know what pixel is currently being computed in PS2.0 (HSLS) ?

This topic is 5451 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How can I know what pixel is currently being computed in PS2.0 (HSLS) ? I want to sampler a color in screen-aligned texture , so I need a location of pixel that is being computed. Thank you.

Share this post


Link to post
Share on other sites
Advertisement
You could pass the screen position through to the ps by adding a field to the VS_OUTPUT structure.

Share this post


Link to post
Share on other sites
As far as I know, in HLSL you can not know. Every pixel is processed by the pixelshader, so in your HLSL code is must be a question of doing a test against the current pixel color and doing "whatever you want" if the test == true.

Correct me if I'm wrong ..

Share this post


Link to post
Share on other sites
Quote:
Original post by Donavon Keithley
You can always calculate the screen coordinates in the vertex shader and then pass them in to the pixel shader.


That's what I meant and said ;)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!