Jump to content
  • Advertisement
Sign in to follow this  

hlsl static float4

This topic is 4133 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!