开发者

How do I set the value of a HLSL uniform variable with SlimDX?

I haven't been able to find the documentation for this, but it's probably prett开发者_C百科y simple. I have a pixel shader which needs variables to be updated. The only thing I've come close with is the ConstantTable, but it's under Direct3D9 and not Direct3D11 which is what I'm using.

Using DirectX11 with SlimDX, how would I set the value of uniform variables I have in the shader?


Direct3D 10 and 11 use the idea of constant buffers. The SlimDX Buffer class is the type you're looking for. Alternatively, if you're using effects, you can use one of the GetVariableBy* methods to get and set its values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜