SDF example 2: snapping particles to the surface of an object by using an sdf. (part 3/3)
PART 1: Understanding how an sdf works, sampling the sdf value and the gradient of the sdf. • Understanding the SDF - Signed Distance Fi... PART 2: Example 1 - sampling and displacing the sdf using the gradient of the sdf. • SDF example 1: sampling and displacing the... PART 3: Example 2 - snapping particles to the surface of an object by using and sdf as a data acceleration structure. (this video) Add me on Instagram: pclaesvfx Hipfile: http://bit.ly/sdf_hipfile OVERVIEW: We are going to emit particles from the surface of the pigshead and make use of the sdf inside of a sopsolver to efficiently snap the particles to the surface of the object. We will also explore snapping using the ray sop although this is computationally more expensive. FIRST: We subdivide the pigshead so we get a smooth and detailed sdf when converting from polygons using the vdbfrompolygons. SECOND: We scatter a bunch of points on the surface and color them by bounding box. THIRD: Next we create a dopnet (as a popnet which will preconfigure it for us) and we emit all the particles on the first frame. There is also a popwind appended to the popsource so there is a bit of curlnoise happening in the system. FOURTH: We are adding a sopsolver to the popsolver to perform the snapping to the surface. Inside of the sopsolver we will explore two ways of snapping. FIFTH: First we will reference the polygonal surface and use a ray sop set to minimum distance to snap the points to the polygonal surface. Although this works, this is computationally expensive as the distance is computed every substep for each point. SIXTH: Next we will perform the snapping by making use of the sdf. The particles will need to snap to the zero isocontour of the sdf, which represents the surface. To do this we use an attributevop on the points inside of the sopsolver. In the attributevop we compute the gradient of the sdf for each point, normalize and negate that vector and multiply it by the volume sampled sdf value. This resulting vector is added to the incoming position and will displace the points onto the surface. SEVENTH: The sdf snapping operation is quite fast as it does not need to compute the distance and instead performs a lookup. If the target geometry is animating, then we could bake out the sdf volumes to disk before using them in the dopnet. EIGHT: We can trail the points and create lines from them. The lines are created with an add sop, set to 'Polygons', 'By Group', add: 'By Attribute' and then using the 'id' attribute that is created for each point as part of the particle creation in the dopnet. NINTH: We can turn the lines into polywire to render them. Alternatively we can give the particles a density attribute, rasterize the particles into a vdb fog volume and then convert that fog volume to polygons. The rasterize attribute node is fast, but has limited control although it will make use of the 'pscale' attribute that is present on the points. Another way of getting to a smooth polygonal representation of the lines is by using the vdbfromparticles node which creates and sdf and this will also make use of the 'pscale' attribute. We can then smooth this sdf using the vdbsmoothsdf and convert the resulting sdf to a polygonal mesh. TENTH: This setup is really useful when used in combination with a fuzzy logic system where agents traverse the surface. Which means you would be doing a distance calculation a lot. So instead we are doing a lookup through the volume sample. If the surface is animation, we can bake them out beforehand (in parallel on a render farm). Vdbs and sdfs are super useful as they are part of Houdini's data acceleration structures. For business or one-on-one visual effects consulting inquiries, you can reach me at [email protected]

Understanding the SDF - Signed Distance Field (part 1/3)

How much does it COST? - shortest path mask

The Cross product: Theory (1/3)

Understanding the DOT product!

Trump Gets Booed & Falls Asleep During NBA Finals, Claims War is Almost Over & Goodbye Spencer Pratt

The Insane Genius of a Formula 1 Gearbox

Blender Basic Organic Modelling Tutorial (Donut Part 3)

But what is the Fourier Transform? A visual introduction.

How to make 3D Games in Godot

What The Architect Scene in The Matrix ACTUALLY Means

Something is jamming GPS over Europe. Here's what we found

Animation vs. Coding

Bad Luck Trump Ruins Knicks' Winning Streak & Spencer Pratt Loses L.A.'s Mayor Race | The Daily Show

Why trains don't usually crash into each other

But what is quantum computing? (Grover's Algorithm)

The SDF of a Box

How to make a Video Game - Godot Beginner Tutorial

Exposing The Solid State Donut Battery. It's Over.

6 Blender Hard-Surface Modeling Tricks I Wish I Knew Earlier

