PIX is right and the screen is wrong

Started by
2 comments, last by Nik02 12 years, 9 months ago
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.
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..
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.

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.

Niko Suni

This topic is closed to new replies.

Advertisement