让我们把到目前为止我们所知道的所有东西结合起来 let's take all that we know until now and combine it
这将是几个设置的基础 and this is going to be the basis for a few setups
所以让我们首先把柏拉图式的立体 so let's just first set the platonic solid
再次成为二十面体 to be an icosahedron again
让我们把这一切都删掉吧 let's delete all this down here
所以我们被困在这个来自多边形的VDB中 so we're stuck with this vdb from polygons here
让我们先下拉一个空值 let's drop down a null first
因为我们稍后要做的是将该设置 because what we want to do later is put that setup
我们正在构建一个解算器 that we're just building into a solver
因此，这将是我们从求解器中输入的内容 so this will be our input from the solver
那我们就把这个打进来吧 then let's call this in
我想要做的第一件事是下拉两个VDB分析Subs and the first thing i want to do is drop down two vdb analysis subs
让我们复制这个，并将其称为梯度 let's just copy this one and call one grad gradient
另一条曲线用于曲率线的输入，两者都 and the other one curve for curvature wire in the input to both
让我们将其设置为一个渐变 and let's set up this to be a gradient
当我们用鼠标中键点击它时 and when we middle mouse button on this
我们看到这个体积叫做表面 we see the volume is called surface
所以它应该存储渐变 so it should store gradient
所以让我们把这个重新命名 so let's just rename this
我们可以在这里选择一个自定义名称，然后将其命名为 we can select a custom name here and just call it
让我们设置这个vb分析来得出我们的曲率 let's set this vb analysis to yield our curvature
让我们也把这个叫做 and also let's call this
现在我想做的是 now what i want to do
我想用我的物体的曲率 i would like to use the curvature of my object
以推动平流的强度 to drive the strength of the advection
因为在本质上，我想要构建的是相同的设置 because in essence what i want to build is the same setup
就像我们在前两个项目中所做的那样 as we did in the two previous projects
但现在我想用曲率来驱动平流 but now i want to drive the advection by the curvature
所以本质上我需要做的是 so in essence what i need to do is
我需要把梯度和曲率相乘 i need to multiply the gradient and the curvature
但我也要照顾这些奇怪的价值观 but also i have to take care of these weird values
这种曲率会产生 that curvature yields
有时候 sometimes
所以我应该重新映射它，让我们在一个卷中完成所有这些操作 so i should remap this and let's do all this within a volume
鲍勃·B让我们把它放在这里 bob b let's drop that down in here
在第二个曲率的第一个槽中的渐变中的管道 pipe in the gradient in the first slot of the curvature in the second
然后潜入水中 and then dive in there
音量bob的工作原理与点bob或bob非常相似 and the volume bob works really similar to the point bob or the bob
所以到最后 so in the end
我们希望使用Find导出输出的是一个名为GRADER的浮点型 what we want to output with a find export is a float called gradient
所以这将是我们的输出 so this is going to be our output
我们想拿着一个球样来采样这两块田地 and we would like to sample those two fields coming in here with a ball sample
所以样本向量是针对三个输入一的梯度 so the sample vector is for the gradient coming in three input one
样本标量是针对进入输入2的曲率 and the sample scalar is for the curvature coming into input two
并且两者都需要当前体素位置 and both need the current voxel position
哪一个是否定的 which is no
P我告诉过你这里也是一样的 p i told you like this same here
就像这样，现在让我们重新映射该曲率值 like this now let's take care of remapping that curvature value
我要下拉的第一件事是一个Fit节点 and the first thing i'm going to drop down is a fit node
适配范围节点 fit range node
或该曲率值中的管道 or a pipe in that curvature value here
并指定最小值和最大值 and specify a minimum and maximum value
让我们随意地从-10到10 and let's just arbitrarily go from minus ten to ten
在之前的设置中，该值适用于大多数几何类型 this is a value that in previous setups kind of worked for most geometry types
所以在我们做完这些之后 so after we've done that
让我们从坡道上下来吧 let's drop down a ramp
将其设置为样条线渐变 set this to be a spline ramp
这样我们就可以随心所欲地重新映射曲率 so we can remap the curvature as we like
最后将曲率和梯度与乘法结点相乘 and finally multiply both the curvature and the gradient with a multiply node
先在渐变中放置管道 pipe in the gradient first
然后将渐变和拟合曲率输出为新的渐变 and then the ramped and fitted curvature and output this as our new gradient
这里 here
我们在一个输入上读入梯度，在另一个输入上读入曲率 we read in the gradient on the one input and the curvature on the other input
然后将曲率从负10到10拟合到0到1的范围内 then fitted the curvature from minus ten to ten into the range of zero to one
然后使用渐变节点能够影响从0到1的范围 and then use a ramp node to be able to influence that range from zero to one
然后将梯度与我们生成的值相乘 and then just multiply the gradient with that value we generated
所以我们基本上是在渐变中缩放向量的长度 so we basically scale the length of the vectors in the gradient
好吧 okay
在我们完成这项工作之后 after we've done that
让我们再来一次vb向量 let's drop down a vb vector again
在这里输入我们的传入几何体和我们刚刚在这里创建的矢量场 pipe in our incoming geometry in here and our vector field that we just created in here
让我们只需按鼠标中键来查看 let's just middle mouse button on this to see
是 yes
我们有一个梯度场穿过这里 we have a gradient field coming through here
我们稍后可能要做的一件完美的事情是在这里添加一个平滑的 perfect one thing we might later do is add a smooth in here
平滑渐变 to smooth out the gradient
或者在我们将BDB一分为二之前 or maybe up here before we divide the bdb into the two
VB分析节点 vb analysis nodes
也许在重塑节点以扩展vdb maybe at a reshape node to dilate the vdb
但我们可以在稍后看到这一点 but we can see that later for now
让我们只强调这一点 let's just highlight this
我们立即发现，我们的数据量只会被感染 and we immediately see that our volume only gets infected
在有曲率的区域周围 around the areas where there is curvature
这正是我们喜欢的 which is exactly what we like
在这里我们还可以做的是重新映射曲率值 also within here we can do is remap the curvature value
所以 so
例如 for example
当我把这一端拨到c10的时候 when i dial this end up to a value of c ten
我现在可以看到我的VDP在Vectors非常积极 i can now see my vdp at vectors really aggressive
而且它已经截断了其中的一些值 and it already truncates some of those values
所以让我们把它归结为一个 so let's boil it down to one
复制这些笔记并将其放入我们的vb中的求解器线中。 copy this bunch of notes and put it into a solver wire in our vb
粘贴我们的节点链 paste our node chain
就在这上面 here by this up
突出显示BDB向量 highlight the bdb vector
然后突出显示太阳能和点击播放 and then highlight the solar and hit play
嗯，我们看到在某个点上 well we see at a certain point
这就产生了看起来很有趣的人工制品 this yields artifacts which can look interesting
但在最初的阶段，我们确切地看到了我们怀疑发生的事情 but during the first stages we see exactly what we suspect happening
创建此几何后，边缘周围的区域会受到越来越多的影响 the area around the edge gets infected more and more and again after this geometry is created
它再次输入到求解器中 it's again fed into the solver
所以现在我们在这个区域有了更多的曲率 so now we have more curvature on this area here
产生了这些错综复杂而有趣的结构 which is producing these intricate and interesting structures
让我们试着放一张顺滑的 let's try and drop down a smooth
我们在这里创建了渐变之后 after we created the gradient here
样式在方框半径为两次或六次迭代的范围内 style in a box radius of two and maybe six iterations
顺其自然吧 and let that run
也许这有点太过圆滑了 maybe that was a bit too much smoothing
尽管让我们看看这件事会如何发展 although let's see where this goes
就让它运行吧 just let it run
让我们停止吧，事情就是这样 let's stop that that is so so
所以让我们试着调整一下这里 so let's try tweaking in here
暂时禁用此功能 disable this for a while
我们还可以做的就是平稳地 what we could also do is smooth
从具有BDB的VDB中产生的结果VDB the resulting vdb that comes out of the vdb with a bdb
平滑的SDF电线在这里 smooth sdf wire that up here
让我们看看这是如何发展得很好的 let's see how that evolves well
这大同小异 that's more or less the same
所以让我们也停止这一点 so let's stop that as well
试着为这个看起来有点像玉米棒的东西找一些好的参数 and try finding some nice parameters for this looks a bit like a corn cob
不太有趣 not too interesting
要么 either
这也不是问题所在 that's not on point either
这看起来有点像一个变异的足球 that looks a bit like a mutated soccer ball
现在它变得更有趣了 now it gets a bit more interesting well
不过 nevertheless
您希望在此设置中调整的主要参数 the main parameter that you'd like to tweak in this setup
都在求解器中 are in the solver
在音量球中 in the volume ball
实际上这条曲线 actually this curve
以及Fit节点 and also the fit node
所以源最小值和最大值 so the source minimum and maximum
以及此渐变参数 as well as this ramp parameter
你会调整你的方法来度过难关 that you're gonna tweak and work your way through
这可能看起来不是很多 and this might not look like much
但这将是未来几个非常有趣的设置的基础 but this is gonna be the basis for a few very interesting future setups
所以让我们把这件事弄清楚 so let's just clean this up
这是一个非常紧凑的设置 and it's a very compact setup
所以让我们先把这个留到现在 so let's just save this for now
并在此基础上构建更高级的东西 and build something a bit more advanced on top of this