Skip to main content
GameDev.net gamedev.net
🔒 Locked

hlsl static float4

Started by devronious Jan 27, 2007 at 3:53 PM 1 replies 800+ views
Original Post
devronious
devronious
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
sirob
sirob
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.
devronious
devronious
Yes that helps, thanks.

-Devin

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.