五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

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

Styled SDF for Bezier curve 1

2022-04-12 15:51 作者:DeadCyber  | 我要投稿


Final result
The quadratic Bezier spline

Origin:

In SDF?render scene, I want to render a Bezier curve, but what i found from?shadertoy, is just a simple Bezier segement SDF:


PS:??By segement I mean it?only got 3 points, not the entire multi-points?smooth bezier spline?.

Which means doesn't support the entire spline, and it's not 3D, what's more its caps and body are?rounded shaped,different from what I need ---?box shaped lines:

So I need to find a way to render Bezier curve SDF in box style.

Continue:

For the body SDF

? From the shadertoy code, we can get the 2D distance to the body. It's done by calculating?our point P's project point T on the Bezier segment, using the relationship that:

dot(TP%2CT')%3D0

which means TP is the normal direction of T in the segment.

Combine the height difference,we can get the diffenrence float2 TP in the normal plane.

Since we want a box style, the SDF shall be calculated as a rectangle SDF:


????We loop the same logic over all segements of the spline,and find the min as SDF for the body.Note for a valid body SDF of a segement ,?T must in the segement(as 0<t<1).

For the cap SDF

? ? Body SDF doesn't apply for the 2 end caps.Once we find T of P not [0,1] for all segements, we shound calculate P's SDF for cap. When we find out whether it's start? or end pnt of the spline that's near P,we call that cap point as T too.

? ? For the exact result,one should calculate P's SDF to the one face quad of T. The quad's normal direction U is (p0-p1) or (p[n]-p[n-1]).


????


????However, for convenience, I use a thin box instead.The box {u,v,w} direction is {U,(0,1,0),cross(u,v)}

Combine

????Here's a box style spline only has two segements.The code is very raw, lack of abstraction.


????We can see from above process, that our approach is not only restricted to box style or quadratic Bezier Spline.The similar method can be used for arbitrary style and spline type.I will try tidy it up for next article.





Styled SDF for Bezier curve 1的評論 (共 條)

分享到微博請遵守國家法律
新丰县| 平昌县| 南江县| 桑植县| 井冈山市| 凤阳县| 平乡县| 洛扎县| 中方县| 南投县| 赤水市| 吉安县| 句容市| 额敏县| 田东县| 铁力市| 聂拉木县| 卓资县| 天峨县| 湖南省| 洪江市| 遵义县| 崇明县| 琼结县| 额济纳旗| 渝中区| 土默特左旗| 磴口县| 通河县| 沐川县| 读书| 赤壁市| 泽库县| 车致| 青浦区| 抚顺县| 德化县| 浮梁县| 信阳市| 米易县| 合川市|