Jump to content

What are Signed Distance Field (SDF) and IsoOffset


Recommended Posts

SDF can be used to get the distance and direction towards the surface. isoOffset can create the SDF.

 

But from which point towards the 3d surface ?

i mean what is the source from where the distance is calculated ?

Also in what direction ?

Link to comment
Share on other sites

A couple of pointers

 

In mathematics and applications, the signed distance function of a set Ω in a metric space, also called the oriented distance function, determines the distance of a given point x from the boundary of Ω, with the sign determined by whether x is in Ω. The function has positive values at points x inside Ω, it decreases in value as xapproaches the boundary of Ω where the signed distance function is zero, and it takes negative values outside of Ω.

 

And of course, Side Effects own docs

https://www.sidefx.com/docs/houdini14.0/nodes/dop/volume

Link to comment
Share on other sites

basically the sign distance field of an object is exactly what it's name mean.

 

Field       = a 3D grid where you store data

Distance = in this grid you store a scalar (float) value that contain the distance beetween the point P you evaluate in the grid and the closest point located on the surface of the object Cp

Sign       = because this value can be either positive if the point is outside the object or negative if the point is inside the object

 

so if at

- P1 the SDF value is -5 you know that the point P1 is inside the object at a distance of 5 unit to the object surface

- P2 the SDF value is 0 you know that the point  P2 is on the object surface

- P3 the SDF value is 3 you know that the point  P3 is outside the object at a distance of 3 unit to the object surface

 

IsoOffset like VDB or FluidSource can be use to create a SDF . isoOffset tend to be legacy imo

- FluidSource and VDB are more popular and faster to create SDF

 

EDIT : Jordi was faster than me ... :)

Edited by sebkaine
Link to comment
Share on other sites

A couple of pointers

 

In mathematics and applications, the signed distance function of a set Ω in a metric space, also called the oriented distance function, determines the distance of a given point x from the boundary of Ω, with the sign determined by whether x is in Ω. The function has positive values at points x inside Ω, it decreases in value as xapproaches the boundary of Ω where the signed distance function is zero, and it takes negative values outside of Ω.

 

And of course, Side Effects own docs

https://www.sidefx.com/docs/houdini14.0/nodes/dop/volume

 

 

Yes, this definition is in  https://en.wikipedia.org/wiki/Signed_distance_function

But its very mathematical :wacko:

Also, the Sidefx doc is not in simple terms.

:mellow:

Link to comment
Share on other sites

Yes, this definition is in  https://en.wikipedia.org/wiki/Signed_distance_function

But its very mathematical :wacko:

Also, the Sidefx doc is not in simple terms.

:mellow:

 

If you don't look at the formulas for a second you will see it is actually a simple concept and explanation.

 

 

Translation

determines the distance of a given point x from the boundary of Ω

 

can be read as

 

determines the distance of a given point x from the surface

 

where outside is positive, inside negative and in the surface is zero.

 

that is all.

  • Like 1
Link to comment
Share on other sites

basically the sign distance field of an object is exactly what it's name mean.

 

Field       = a 3D grid where you store data

Distance = in this grid you store a scalar (float) value that contain the distance beetween the point P you evaluate in the grid and the closest point located on the surface of the object Cp

Sign       = because this value can be either positive if the point is outside the object or negative if the point is inside the object

 

so if at

- P1 the SDF value is -5 you know that the point P1 is inside the object at a distance of 5 unit to the object surface

- P2 the SDF value is 0 you know that the point  P2 is on the object surface

- P3 the SDF value is 3 you know that the point  P3 is outside the object at a distance of 3 unit to the object surface

 

IsoOffset like VDB or FluidSource can be use to create a SDF . isoOffset tend to be legacy imo

- FluidSource and VDB are more popular and faster to create SDF

 

EDIT : Jordi was faster than me ... :)

 

Nice explanation sebkaine :) Thanks

But what is the "use" of creating such a surface ?

Link to comment
Share on other sites

Here...

 

Thanks ChristianW :)

 

1)

So in order to place the particles on the geometry (with multiplier exposed to animate the effect), you created SDF of the object right ?

Basically getting the SDF of the geometry gives us what kind of freedom to perform what kinds of effects ?

i mean in which cases one has to think of creating SDFs of the geometry ?

 

2)

And sebkaine  mentioned that IsoOffset (like VDB and FluidSurface ) are used to create SDFs, then what is the use of creating FogVolume in IsoOffset ?

:mellow:

Link to comment
Share on other sites

Fog volume is just density, so fog... :) or whatever volumous kinds of things you want to create. Of can use it to just scatter inside of an object rather than surface etc..

 

SDF is invaluable! So you could create your own collisions using them, have blood drip over an object, use it to calculate a follow path, I recently used it to calculate denting between vehicles, endless...

 

You just need to start using them, then you'll work it out. Just think of it as supplying a vector with magnitude to the surface of an object. Then next time you want to do something that requires that re-visit this thread.

 

Ohh you could use it for booleans as well. Once you understand what they are you'll figure out loads of stuff.

Link to comment
Share on other sites

Fog volume is just density, so fog... :) or whatever volumous kinds of things you want to create. Of can use it to just scatter inside of an object rather than surface etc..

 

SDF is invaluable! So you could create your own collisions using them, have blood drip over an object, use it to calculate a follow path, I recently used it to calculate denting between vehicles, endless...

 

You just need to start using them, then you'll work it out. Just think of it as supplying a vector with magnitude to the surface of an object. Then next time you want to do something that requires that re-visit this thread.

 

Ohh you could use it for booleans as well. Once you understand what they are you'll figure out loads of stuff.

 

Thanks ChristianW :)

 

SDFs provides a vector with magnitude of what ?

 

Hmm.. m jus curious to know the cases where one has to create SDFs.

coz m still figuring out ways to use them and still the concept of utilizing them is still unclear.

Link to comment
Share on other sites

SDF is great for anytime you need to know if a point is within a volume.  You basically look up a point in the SDF and it will return a value based of the Signed Distance from the surface of the volume nearest the point you provided, i.e. a point on the surface would be 0 where a point in the middle of the volume could be -1 and a point not in the volume could be 3.

Edited by captain
  • Like 1
Link to comment
Share on other sites

An SDF is basically an acceleration structure in the form of a lookup table - though, in this case the SDF is a 3D lookup table. The SDF covers the bounding box of the geometry.

 

If you have 2 geometries, and you want to determine if they've collided, you first check if their bounding boxes intersect. If they do, a more complex calculation is needed. Without an SDF, you'd have to compare each point in the geometry to the surfaces in the other geometry - a very, very expensive operation involving a lot of projections onto each polygon plane. With an SDF, you just transform the point into the SDF's local space and look up the distance.

 

Isooffset does the initial calcuations for the SDF, incurring a one time cost which can be reused in collision detection.

  • Like 1
Link to comment
Share on other sites

Fog volume is just density, so fog... :) or whatever volumous kinds of things you want to create. Of can use it to just scatter inside of an object rather than surface etc..

 

SDF is invaluable! So you could create your own collisions using them, have blood drip over an object, use it to calculate a follow path, I recently used it to calculate denting between vehicles, endless...

 

You just need to start using them, then you'll work it out. Just think of it as supplying a vector with magnitude to the surface of an object. Then next time you want to do something that requires that re-visit this thread.

 

Ohh you could use it for booleans as well. Once you understand what they are you'll figure out loads of stuff.

 

 

Yes Fog is a volumous thing, but is it used to create objects made of fog(ie smoke) and then further apply forces on them ?

can u give an example for basic use of FogVolume in IsoOffset. i.e. an application of IsoOffset with FogVolume.

 

i've heard SDF is used for FLIP Collisions as it is faster, i've even tried it. But besides that, they must be useful in RBD collisions as well, right ?

And applications like:

1). creating SDF for our own collisions,

2). blood drip on object & use it to calculate follow path,

3). Booleans

is still m trying understand how. Will work on it :)

 

Thanks ChristianW :)

Edited by sultan
Link to comment
Share on other sites

SDF is great for anytime you need to know if a point is within a volume.  You basically look up a point in the SDF and it will return a value based of the Signed Distance from the surface of the volume nearest the point you provided, i.e. a point on the surface would be 0 where a point in the middle of the volume could be -2 and a point not in the volume could be 3.

 

Got it captain !!

 

m using SDF to know more about it and the various applications in which it will be useful.

 

Thanks captain :)

Link to comment
Share on other sites

An SDF is basically an acceleration structure in the form of a lookup table - though, in this case the SDF is a 3D lookup table. The SDF covers the bounding box of the geometry.

 

If you have 2 geometries, and you want to determine if they've collided, you first check if their bounding boxes intersect. If they do, a more complex calculation is needed. Without an SDF, you'd have to compare each point in the geometry to the surfaces in the other geometry - a very, very expensive operation involving a lot of projections onto each polygon plane. With an SDF, you just transform the point into the SDF's local space and look up the distance.

 

Isooffset does the initial calcuations for the SDF, incurring a one time cost which can be reused in collision detection.

 

 

IsoOffset does the work of creating the SDF. Got it :)

 

Hmm... m still figuring how to do collision detection between 2 objects using SDF.

have used it for collision with FLIP, as have heard that its faster.

 

 

Thanks malexander :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...