游戏开发论坛

 找回密码
 立即注册
搜索
查看: 5087|回复: 2

新手提问关于多重采样质量MultiSampleQuality

[复制链接]

15

主题

40

帖子

40

积分

注册会员

Rank: 2

积分
40
发表于 2009-11-27 15:16:00 | 显示全部楼层 |阅读模式
多重采样类型MultiSampleType比较好理解

多重采样质量MultiSampleQuality不是很理解,书上一般都设置0, SDK里解释如下
Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by IDirect3D9::CheckDeviceMultiSampleType. Passing a larger value returns the error D3DERR_INVALIDCALL. Paired values of render targets or of depth stencil surfaces and D3DMULTISAMPLE_TYPE must match.

只能设置0~1.0吗,
如果采样类型是D3DMULTISAMPLE_8_SAMPLES,或4 等
多重采样质量应该设置多少才合适?

另外想确定一下, 在CheckDeviceMultiSampleType(),第三个参数SurfaceFormat, 需要把后台缓冲格式和 深度模板格式两种格式都测试吗?

[em24]

59

主题

984

帖子

1200

积分

金牌会员

Rank: 6Rank: 6

积分
1200
发表于 2009-11-27 16:03:00 | 显示全部楼层

Re: 新手提问关于多重采样质量MultiSampleQuality

This parameter is deliberately left vague in the DX documentation, because it is mostly up to the driver to define what it means.

It is needed because even within a fixed number of samples, there can be different ways of implementing the details. For instance with 2x AA, do you just double the width of the backbuffer, or do you rotate the sample kernel? When downsizing, do you just average two samples for each output pixel, or perform some more sophisticated (and hence expensive) filter to get better results? For instance in the GeForce3/4 NVidia implemented Quincunx filtering, which renders with a rotated 2x AA kernel but then samples five surrounding values to compute each output pixel.

The API needs a way to control which option you want, but it doesn't really know what options the driver may have implemented, so MultiSampleQuality gives a way for the driver to report "ok, I support 3 different ways of doing 2x AA", and then the game can say "right, I want the second of those".

Of course, it's not easy to make a sensible choice here because you don't really know what the different options represent (unless you happen to recognise the card) so most often this value should be left alone. Plus, even if you do try to specify it a lot of drivers do crazy stuff like overriding what the game requests based on control panel settings made by the user, at which point the whole thing becomes irrelevant in any case!

14

主题

345

帖子

376

积分

中级会员

Rank: 3Rank: 3

积分
376
QQ
发表于 2009-12-2 13:05:00 | 显示全部楼层

Re:新手提问关于多重采样质量MultiSampleQuality

就是反锯齿, SDK里有个专门讲这个的例子
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-6-17 15:58

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表