hlsl static float4

Started by
1 comment, last by devronious 17 years, 2 months ago
I want to capture a value from the pixel shader and store it in a static variable then later recal the value in the pixel shader. But the debugger shows me that it simply ignores the following statements in the hlsl fx file: static float4 bounds; vsO vsMaster(vsI i) { vsO o; o.p0 = mul(i.p0, wvp); o.c0 = i.c0; o.t0 = i.t0; o.t1 = float2(i.p0.x, i.p0.y); bounds = i.c1; return o; } float4 psMaster(psI i) : COLOR { float4 d = bounds; float4 c = tex2D(samp, i.t0); c *= i.c0; return c; } how can a pass the data to the pixel shader without it interpolating the value. I am under the assumption that values passed to the pixel shader thru input and output registers are interpolated per pixel. Thanks, Devin
Advertisement
You can't. The only way to output data frame the vertex/pixel shader is by using the output registers.

You can turn off interpolation using a renderstate, D3DRS_SHADEMODE, but the effect would be global, for all Color marked outputs.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Yes that helps, thanks.

-Devin

This topic is closed to new replies.

Advertisement