Рет қаралды 11,831
For anyone who wants to learn how to advect curves by a volume and create beautiful wispy details. Add me on Instagram: pclaesvfx
Hip file: bit.ly/curve_advect_hipfile
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:
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