最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

TextureBased SDF Slice

2022-08-03 12:21 作者:DeadCyber  | 我要投稿

Background

I want to have 3D font in my game.

????However,it seems my Quadratic Bezier SDF Algorithm is too heavy when I place the 'B' into the scene.You can see from up above,it makes FPS from 50 down to 20.?

????It's very frustrating.Because when I created the font in an empty scene initially,the FPS seems OK to me:

?

quadBezier spline 'B' in an empty scene,500FPS
'B' is created by 1 box and 2 splines

I look back on the empty scene without 'B',wow it's 1000FPS:

1000FPS:SDF Trace simple geometry is very fast

It seems like absolute FPS doesn't mean a thing,the relative proportion does.Our 'B' drop 50%!

Since a spline based 'B' is so heavy,I want to use texture based SDF.

Let's try it!

Generate SDF texture

????The important thing is that you save the value by pixel distance,and do not normalize it,otherwise there'll be a problem.I havn't fully found the reason, but this procedure solve the issue: don't normalize it in SDF Texture

sphereSDF.exr,save SDF in R channel

Calculate SDF Slice in Shader

With a bound condition,we get a single slice.Same view, up to 1000FPS,almost cost free:

FPS just like an empty scene

Get closer,the precision is acceptable.Afterall,it's texture based,can't compare with a 'perfect' spline based one:

TextureBased.Precision is acceptable.
SplineBased.Perfect but too expensive.

Thanks to SDF Trace and TextureBased SDF Slice,allows infinite instances at a relative cheap cost:


TextureBased SDF Slice的評論 (共 條)

使用qq登录你需要登录后才可以评论。
香格里拉县| 宿迁市| 富蕴县| 久治县| 上林县| 锡林郭勒盟| 米泉市| 贵德县| 开鲁县| 壶关县| 广灵县| 宝山区| 博爱县| 拜城县| 本溪| 百色市| 宁蒗| 文山县| 夏津县| 门头沟区| 长垣县| 临漳县| 灌云县| 江门市| 秭归县| 张家港市| 洮南市| 阿瓦提县| 海门市| 芒康县| 无棣县| 邵东县| 大关县| 深水埗区| 历史| 昭通市| 揭阳市| 临清市| 邵东县| 宜兰市| 苏州市|