Position from Depth, why is Y inverted?

If you want to see some of the values in the shader for your matrices or other globals.
You can use this pixel shader i made to do it.

I did this just to see if i could but also to see matrix values on the shader.

To use it you add the functions into your shader file and then insert the calls into the end of your pixel shader which intercept and alter the color output. This will only work on static values or static values like matrices which are the same per pixel.

Ex,

// Display the mouse x value.
float valuetotest = MouseLocation.x; 
currentColor = FuncDrawValue(valuetotest, curpixel, currentColor, TextPosition, lineSize, lineColorWhite);

// Display the mouse y value.
float valuetotest2 = MouseLocation.y;
currentColor = FuncDrawValue(valuetotest2, curpixel, currentColor, TextPosition + float2(250.0f, -2.0f), lineSize, lineColorWhite);

// draw the lines.
currentColor = DrawLine(position.xy, currentColor, b, a, lineSize, lineColorRed);
// draw the points a
currentColor = DrawPoint(position, currentColor, a, pointSize, lineColorRed);
// display circular radius about midpoint m.
currentColor = DrawCircleAtRadius(position, currentColor, m, length(c - b) * 0.5f, 3.0f, lineColorYellow);


return currentColor;

I didn’t decode them proper using IEEE 754 so they will be a trivial bit off.