Jump to content
  • Advertisement
Sign in to follow this  
JB47394

PIX is right and the screen is wrong

This topic is 2556 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

I'm trying to compose a pixel value in a pixel shader. When I run the application, I get a result I don't expect. When I step through PIX's "Debug Pixel" and look at the returns from my pixel shader, the numbers look exactly as I expect.

The expected values should produce a kind of two-color color ramp. Instead of that, the displayed values are solid color 1 overlapping solid color 2. I can't correlate the output of the pixel shader with what I'm seeing on the screen. I've made some simple changes to the output, such as taking out the red, and those changes do make a difference in the final display.

What happens to a pixel after it leaves the pixel shader that could produce such a change? I have a bare-bones pipeline. I'm drawing one quad with a pass-through vertex shader and my color-interpolating pixel shader. I think I have a call to look at the viewports between the DrawIndexed call and the Present. There's just nothing there jumping out at me.

Any ideas, insights or suggestions would be welcomed. And yes, I realize that the fault lies with me and not with DirectX or PIX.

Share this post


Link to post
Share on other sites
Advertisement
So the values for RGBA are the expected, but the picture of the rendered frame(at pix also) is different?
There arent any warning like "the pixel is excluded from frame due.."(at the draw call where you find the expected values )?
It just come to my mind that at some draw calls everything is fine, but the final frame is different, then if you check the pixel there is those warning telling you its not the final value, due failing depth test i.e..
Just a thought..

Share this post


Link to post
Share on other sites
The answer to what happens between sending a pixel out of a pixel shader and it being used is that the color values are clamped to (0.0, 1.0). I was using Windows' (0.0, 255.0) values as inputs, interpolating them, and passing them out of the pixel shader. The pipeline then clamped them. By supplying (0,0, 1.0) values to my shader, it produces the expected output.

Thanks for your thoughts.

Share this post


Link to post
Share on other sites

The answer to what happens between sending a pixel out of a pixel shader and it being used is that the color values are clamped to (0.0, 1.0). I was using Windows' (0.0, 255.0) values as inputs, interpolating them, and passing them out of the pixel shader. The pipeline then clamped them. By supplying (0,0, 1.0) values to my shader, it produces the expected output.

Thanks for your thoughts.



This is not necessarily true. If you have a floating-point render target surface, the pixel shader output values are not clamped to 0...1.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!