加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

UnderstandingTargetIndependentRasterization

(2023-04-21 21:50:19)
标签:

it

分类: 技术

TanL mentioned several times of alpha-to-coverage on the meeting today, though TIR is not A2C, suddenly this reminds me of one thing: 

- in some sense, MS is trying to use Target Independent Rasterization for "coverage-to-alpha", inverse to alpha-to-coverage idea. 

 

for alpha-to-coverage, 

the feature tries to utilize PE/BLT for MSAA resolve, to kind of solve order independent alpha blend problem. 

- so 'alpha' needs to be converted a coverage mask so that PE/BLT can resolve, following naive/dither rule on sample pattern. 

 

On the contrary, TIR/"coverage-to-alpha" is trying to tackle per-primitive 2D MSAA immediate update problem,  

so instead, the way it utilize PE is alpha blend, not MSAA resolve now. 

- so single sample render target in PE is enough, while the 2D anti-aliasing effect is mimiced by converting 16x coverage mask to alpha blend factor, hence the stroke color can be mixed up with background color, 

e.g. 0xffff means 1.0f and 0xf0f0 means 0.5f. Though strictly speaking, MS defines its pixel shader logic depending on 2D overlap/non-overlap cases respectively. 

 

By  "coverage-to-alpha", Direct2D can make sure each time when it draws a stroke, the antialiasing resolve effect (actually blend) takes place immediately, 

otherwise, if using full 3D MSAA pipeline directly, it's full-screen antialiasing, i.e. only after ALL strokes are drawn, all occlusion relationship among primitives calculated, then the final MSAA resolve happens. 

- this would be counter-intuition on 2D drawing, the correct rendering effect should be: 

  imagine you draw Chinese characters on paper, like ''", with 2 colors, when the 1st stroke is drawn it should blend with the paper immediately, 

  and when the 2nd stroke is drawn, it should blend with the 1st stroke's blend result, also immediately. As you see, the intermediate blend result is crucial, if you reverse the order of drawing the 2 strokes, the result could become slight different. 

 

This should the core idea of TIR feature. 



0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有