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

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

Styled SDF for Bezier curve 2

2022-04-22 03:20 作者:DeadCyber  | 我要投稿

Part2?following previous article

?

Final Result
Bezier Spline key points

????In last article,we use 'raw' code to do sdf box style quadratic bezier spline.I want to wrap things up,pack code into a function,so the user-side code would be clean.

????However, HLSL?is not a quite "High Level" Shader Language to me, because it doesn't?support dynamic length array?as function parameter(Because we want an arbitrary number of keys points in the spline).Although one can use 'StructuredBuffer' as a dynamic length array, but use?StructuredBuffer means unnecessary transfer of data from CPU to GPU if our spline data is static.

????In the end, I broke down the function logic to 'atom' function, and use a for loop to do it from head to tail, finally wrap them all in a 'MACRO Function'.It feels like a little 'functional programming'? in there to me.Here is the MACRO Function code:

(I like the VS Code theme here,remind me of 《Nier Automata》)

You can see from the following image, how I defined the projection info, and updated the info to get the min dis along the whole body.

The idea of 'Projection Info' is designed to?

  1. hold extra information.

  2. allow the latency?of calculating SDF.(like I do with the spline head and tail)

e.g.,the head and tail of spline's SDF is not calculated here:

With the design of 'Projection Info' and the structure of SDFSpline function below, we can easliy change the style of the body,head,tail:

And you can see it's not?coupling with quadBezier,you can easliy provide any type of spline's head/body/tail info in this function, and the the boxed style 3D SDF of it.

End

????Finally,the user-code is very clean and can be changed easily:


Acutally, since the user-end code is very neat, I can do some 'Automatic Generation Of?SDF HLSL Code' work, to transform an editor scene to a full SDF-Rendered scene, which is? very exciting to me.

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

分享到微博請遵守國家法律
和政县| 嘉义县| 阿坝县| 丰镇市| 仙居县| 邵东县| 镇巴县| 龙陵县| 四会市| 山东省| 通化县| 葵青区| 万盛区| 九江市| 健康| 石棉县| 南平市| 古交市| 灵台县| 大冶市| 卓资县| 竹山县| 都匀市| 凌源市| 大渡口区| 兴城市| 博罗县| 仁化县| 宁武县| 钟祥市| 玉环县| 开平市| 邛崃市| 黔西| 芜湖县| 长寿区| 汕头市| 绥德县| 怀安县| 齐齐哈尔市| 于都县|