流体驱动曲线Will it ADVECT? – advect curve by volume
For anyone who wants to learn how to advect curves by a volume and create beautiful wispy details. Add me on Instagram: pclaesvfx
Today I want to cover an effect done by Chris Harkin. The curves are advected by volumes and create beautiful wispy details. The shading on the curves creates nice highlights so we will take a closer look at the shader too.
Chris Harkin effect:
https://www.sidefx.com/gallery/curve/
FIRST: The Pyro sim.
Create the velocity fields that will be used for the advection of the points.
We create a sphere that will serve as the emitter for a pyro simulation. We do not care about the temperature and heat field, but we DO care about the velocity field. The density is largely for visualization, but the vel field will be used to advect the points of the curves in the next step.
SECOND: The intitial curve geometry.
Create a circle that we will advect by the vel volumes.
We need enough points, 50 should do. By appending a resample we can control the level of detail through the ‘length’ parameter. We also turn on the ‘curveu’ attribute on the resample so we can make use of it later for the purpose of shading the curves.
THIRD: Advecting the curve.
We bring the curve geometry into the dynamic context (DOPS) and advect it by the velocity field of the pyro simulation.
The curve comes into dops through a particle object, a particles solver and a particle source. We want to bring in the entire geometry, so we set the emission type on the pop source to ‘All Geometry’. The Geometry source will come from the ‘first context’.
Next we add in a ‘popadvectbyvolumes’ node and set the Velocity Source to ‘Second Context Geometry’. Press play and the points on the circle should start moving. Although they are now moving, the curve segments are stretching. So we need to add more detail to the curve during the simulation.
FOURTH: Adding detail to the curve.
We are adding detail to curve by injecting a sopsolver inside of the dop network. Inside of this sopsolver we add a resample node which will continuously resample the curve geometry and inject more points into the curve as needed.
FIFTH: Moar circles!!!
We are adding more circles to the source to capture more details during the advection. Also we want to get rid of circle polygons, so by using an ‘ends’ sop after the dop sim, we can ‘Open’ the curve.
SIXTH: Refining the setup.
To ensure that the advected points are following the velocity field closely, we can set the ‘Advection Type’ on the popadvectbyvolumes inside of the dop network to ‘Update Velocity’ instead of ‘Update Force’. This will make it a closer match to the pyro velocity field. Next we modify the length settings on the resample so we have slightly less points. We will still get the interpolated detail from the curve segments because we are advecting a curve vs individual scattered points.
SEVENTH: Visualizing curveu.
In order to create some pleasing colors, we can append an attibute vop to configure the Cd (diffuse color). Inside of the attribute vop, a bind node brings in the per point curveu attribute that is then plugged into the ‘u’ parameter of a rainbow ramp vop. The resulting color from the rainbow is then plugged into the ‘Cd’ attribute which gives us nice colors in the viewport.
EIGHT: Lights, Camera, Render!
We add a camera to the scene to frame up the action. In order to illuminate the curves we also add a key spotlight and a fill light.
Before we start rendering, it is a good idea to break out the final result in a separate object node that we name ‘RENDER_curve’. We also need to define the width of the curves. Next we create a rop network and a mantra node and specify the ‘RENDER_*’ in the Force Objects field and we also force the key and fill light to be included in the render. Then we open a new view pane, pick the render view and kick off the first render.
NINTH: Refining the render & shader.
The default render settings are somewhat noisy, so we increase the Pixel Samples to 6 by 6, which is good for fur or grass and also works well for curves.
Next we create a Material subnetwork and pick a new hair shader from the Material Palette. Then we set the tip and root hair color to be white and we assign the hair material to the RENDER_curve. Re-render and we are getting nice wispy smoke detail. Next we dial down the opacity in the hair shader to a value of 0.5 so the curves blend together better. Finally we turn on ‘Tint with Point Color’ to bring the rainbow point colors into the rendered image.
For business or one-on-one visual effects consulting inquiries, you can reach me at peterclaesbusiness@gmail.com
谷歌翻译:
对于任何想要学习如何通过卷来平滑曲线并创建美丽细节的人。加我在Instagram:pclaesvfx
今天我想谈谈Chris Harkin所做的一个效果。曲线由体积平流并创造出美丽的细节。曲线上的阴影会产生很好的亮点,因此我们也会仔细查看着色器。
克里斯哈金效应:
https://www.sidefx.com/gallery/curve/
第一名:Pyro sim。
创建将用于点平流的力度字段。
我们创建一个球体,作为火焰模拟的发射体。我们不关心温度和热场,但我们关心速度场。密度主要用于可视化,但是vel字段将用于在下一步中平滑曲线的点。
第二个:初始曲线几何。
创建一个我们将通过vel卷来平衡的圆。
我们需要足够的积分,50应该做。通过附加重新采样,我们可以通过“length”参数控制细节级别。我们还打开了重采样的’curveu’属性,以便我们稍后可以使用它来着色曲线。
第三:平流曲线。
我们将曲线几何体引入动态环境(DOPS)并通过pyro模拟的速度场对其进行平流。
曲线通过粒子对象,粒子求解器和粒子源进入dops。我们想要引入整个几何体,因此我们将pop源上的发射类型设置为“All Geometry”。几何源将来自“第一个上下文”。
接下来,我们添加一个’popadvectbyvolumes’节点并将Velocity Source设置为’Second Context Geometry’。按播放,圆圈上的点应开始移动。虽然它们现在正在移动,但曲线段正在伸展。因此,我们需要在模拟过程中为曲线添加更多细节。
第四:向曲线添加细节。
我们通过在dop网络内部注入一个sopsolver来为曲线添加细节。在这个sopsolver内部,我们添加了一个resample节点,它将连续重新采样曲线几何体,并根据需要在曲线中注入更多的点。
第五名:摩尔圈!
我们正在向源添加更多圆圈以在平流期间捕获更多细节。此外,我们想要摆脱圆形多边形,因此通过在dop sim之后使用“ends”sop,我们可以“打开”曲线。
第六:完善设置。
为了确保平流点紧跟速度场,我们可以将dop网络内部的popadvectbyvolumes上的“平流类型”设置为“更新速度”而不是“更新力”。这将使其更接近热火速度场。接下来我们修改重采样的长度设置,这样我们的点数就会少一些。我们仍将从曲线段中获取插值细节,因为我们正在平行曲线与单个散点。
第七部分:可视化曲线。
为了创造一些令人愉悦的颜色,我们可以添加一个attibute vop来配置Cd(漫反射颜色)。在属性vop内部,绑定节点引入每点curveu属性,然后将其插入彩虹斜坡vop的’u’参数。然后将彩虹产生的颜色插入“Cd”属性,这会在视口中为我们提供漂亮的颜色。
八:灯光,相机,渲染!
我们在场景中添加了一个摄像头来构建动作。为了照亮曲线,我们还添加了一个关键的聚光灯和补光灯。
在我们开始渲染之前,最好在我们命名为“RENDER_curve”的单独对象节点中分解最终结果。我们还需要定义曲线的宽度。接下来,我们创建一个rop网络和一个mantra节点,并在Force Objects字段中指定’RENDER_ *’,我们还强制键和填充光包含在渲染中。然后我们打开一个新的视图窗格,选择渲染视图并启动第一个渲染。
NINTH:改进渲染和着色器。
默认渲染设置有些嘈杂,因此我们将像素样本增加到6乘6,这对毛皮或草很有用,也适用于曲线。
接下来,我们创建一个Material子网,并从Material Palette中选择一个新的头发着色器。然后我们将笔尖和根头发颜色设置为白色,然后将头发材质指定给RENDER_curve。重新渲染,我们得到了很好的烟雾细节。接下来,我们将头发着色器中的不透明度调低到0.5,以便曲线更好地融合在一起。最后,我们打开“带点颜色的色调”,将彩虹点颜色带入渲染图像。
For business or one-on-one visual effects consulting inquiries, you can reach me at peterclaesbusiness@gmail.com