积极答复者
如何设置Direct2D 的BlendState?

问题
-
我在用图形调试的时候发现Direct2D渲染中BlendState始终为
我尝试过在D3D11DeviceContext中设置BlendState,但并不管用
我如何能自己设置BlendState?
- 已编辑 James Sunderland 2022年3月16日 3:54
答案
-
费了老大劲,终于搞定了。只能Hook CreateBlendState,虽然麻烦但还可行
- 已标记为答案 James Sunderland 2022年3月17日 2:35
全部回复
-
您好,
你可以参考这个相似线程的答案
Direct3D11 中的所有资源都是不可变的,因此当您创建新的 Blendstate(mDevice, new BlendStateDescription()) 时,您以后无法更改描述。
var blendDescription = new BlendDescription(); blendDescription.RenderTarget[0].IsBlendEnabled = .. // 设置所有值 [...] var blendState = new BlendState(device, blendDescription); context.OutputMerger.SetBlendState(blendState, ...);
Best Regards,
Minxin YuMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
费了老大劲,终于搞定了。只能Hook CreateBlendState,虽然麻烦但还可行
- 已标记为答案 James Sunderland 2022年3月17日 2:35