国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
防城港市| 阿荣旗| 沛县| 利川市| 滨州市| 海伦市| 东丽区| 屏边| 凭祥市| 花莲市| 衡东县| 洛宁县| 阳泉市| 眉山市| 龙江县| 涡阳县| 班玛县| 上蔡县| 黎城县| 定襄县| 卓资县| 吕梁市| 固安县| 邹平县| 黎川县| 察雅县| 阿拉善盟| 太谷县| 徐水县| 灵山县| 昌吉市| 通榆县| 肇州县| 湖南省| 曲松县| 韶山市| 彭山县| 潜山县| 婺源县| 唐海县| 潞城市|