Sign in to follow this  
JB47394

PIX is right and the screen is wrong

Recommended Posts

JB47394    100
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
Icebone1000    1958
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
JB47394    100
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
Nik02    4348
[quote name='JB47394' timestamp='1311254648' post='4838430']
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.
[/quote]


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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this