嘿,我正在用directx11编写msaa,这很容易实现。
但是现在正在尝试制作拆分屏幕,例如,屏幕的左侧没有MSAA渲染,右侧是MSAA渲染,所以我可以看到两者之间的区别。

对于我的想法,我认为,我必须创建两个不同的交换链和不同的场景,并并排渲染在一起,因为我们可以在创建交换链时设置msaa计数。我的意见是不是太多了?是否有任何标准或通用(?!)如何在directx11中实现此效果?只要有几个点子,我会非常感谢!
发布于 2021-02-24 23:19:29
可以设置两个不同的视口,例如:
//You can adjust these numbers as you like
//Left viewport
D3D11_VIEWPORT left_vp;
left_vp.Width = screen_width / 2;
left_vp.Height = screen_height / 2;
left_vp.MinDepth = 0;
left_vp.MaxDepth = 1;
left_vp.TopLeftX = 0;
left_vp.TopLeftY = 0;
device_context->RSSetViewports(1u, &left_vp);
device_context->Draw(3, 0);
//Right viewport
D3D11_VIEWPORT right_vp;
vp.Width = screen_width / 2;
vp.Height = screen_height / 2;
vp.MinDepth = 0;
vp.MaxDepth = 1;
vp.TopLeftX = screen_width / 2;
vp.TopLeftY = screen_height / 2;
device_context->RSSetViewports(1u, &right_vp);
device_context->Draw(3, 0);虽然每帧有2个绘制调用,但这可能没问题
有关更多信息,请阅读以下内容:
https://stackoverflow.com/questions/64831393
复制相似问题