بصری AI گائیڈ

دستخط شدہ فاصلاتی افعال

A signed distance function (SDF) describes a shape by giving, for any point in space, the distance to the nearest surface, with a sign that says whether the point is inside or outside.

اس گائیڈ کو سنیں۔اے آئی نے بیان کیا۔ · ~9 min

اس صفحہ پر10 منٹ کا مطالعہ
  1. جائزہ
  2. اہم نکات
  3. گہرا غوطہ
  4. Sphere tracing a ray against a sphere SDF
  5. حقیقی دنیا کا نفاذ
  6. دستخط شدہ فاصلاتی افعال کا مستقبل
  7. اسے عملی جامہ پہنانا
  8. ذرائع اور مزید پڑھنا
  9. دریافت کرتے رہیں
  10. اکثر پوچھے گئے سوالات

جائزہ

The surface is wherever the value is zero. SDFs drive real-time ray-marched graphics, depth-camera 3D scanning and neural 3D reconstruction methods such as DeepSDF and NeuS.

اہم نکات

  1. A signed distance function returns the distance to the nearest surface, negative inside and positive outside by the DeepSDF convention.
  2. The surface of an SDF is its zero level set, and its gradient at the surface gives the normal.
  3. Sphere tracing, described by John C. Hart in 1996, renders SDFs by stepping along each ray by the distance value.
  4. Union of two SDFs is min(a, b), while intersection and subtraction produce distance bounds rather than exact distances.
  5. Curless and Levoy's 1996 SIGGRAPH paper fused up to 70 range scans into a cumulative weighted signed distance volume.
  6. DeepSDF in 2019 represented a whole category of ShapeNet shapes with a single 7.4 MB neural network.

گہرا غوطہ

A signed distance function, usually shortened to SDF, is a rule that takes any point in space and returns one number: how far that point is from the nearest surface of a shape. The sign carries extra information. By the most common convention, used in the DeepSDF paper, points inside the shape get negative values and points outside get positive values. The surface itself is the set of points where the function equals zero, called the zero level set. A sphere of radius r centered at the origin is the simplest example: its SDF is the length of the point's position vector minus r. A point 3 units from the center of a sphere of radius 1 has a value of 2, and the center has a value of -1. Because the description is a function rather than a list of triangles, it is called an implicit representation of the surface.

An SDF can come from three places. It can be written as a formula, as shader programmers do for spheres, boxes, capsules and tori. It can be stored as samples on a 3D grid of voxels, small cubes of space, with values between grid points interpolated. Or it can be learned by a neural network that takes a 3D coordinate as input and outputs the distance. In every case the same two operations matter: evaluating the distance at a point, and finding where the value crosses zero.

Rendering an SDF directly uses a technique called sphere tracing, described by John C. Hart in The Visual Computer in 1996. A ray leaves the camera. At each step the renderer evaluates the SDF at the current point. That value is the radius of a sphere guaranteed to contain no surface, so the ray can safely jump forward by exactly that much. Steps are long in empty space and shrink as the ray approaches a surface, and the loop stops when the value falls below a small threshold. The guarantee holds when the function never overstates the true distance, a property the paper ties to the Lipschitz condition, which limits how fast the function can change. The gradient of the SDF at the hit point gives the surface normal for lighting.

Combining shapes is where SDFs become a modeling tool. Given two SDFs a and b, the union of the shapes is min(a, b), the intersection is max(a, b), and subtracting a from b is max(-a, b). Smooth versions replace min and max with blended functions controlled by a radius k, producing organic joins without seams. Inigo Quilez's widely used reference of distance functions makes an important distinction: basic primitives such as the sphere and box are exact, while subtraction, intersection, smooth blends and non-uniform scaling produce bounds, values that are never larger than the true distance but may be smaller. Bounds still render correctly with sphere tracing but need more steps, and they can break effects that rely on true distances, such as soft shadows.

SDFs also became the standard way to merge real scans. In 1996 Brian Curless and Marc Levoy presented a volumetric method at SIGGRAPH that adds each range image into a cumulative weighted signed distance function stored on a grid, then extracts the zero isosurface. They showed the result is least-squares optimal under certain assumptions, integrated up to 70 range images, and produced models of about 2.6 million triangles. The DeepSDF authors credit that work and KinectFusion (Newcombe and colleagues, 2011) as the pioneers of truncated SDF fusion, in which distances are stored only near the surface. KinectFusion applied the idea in real time with a moving Kinect depth camera.

Neural SDFs arrived in 2019. DeepSDF, from researchers at the University of Washington, MIT and Facebook Reality Labs, trained an eight-layer fully connected network with 512-unit layers to output the SDF of a shape given a 3D point and a latent code, a short vector identifying which shape. Training samples 500,000 points per ShapeNet mesh, concentrated near the surface, and clamps distances to 0.1 so capacity is spent near the surface. One network represented an entire shape category in 7.4 MB, and the paper reports state-of-the-art shape reconstruction and completion from partial, noisy scans. In 2020 Implicit Geometric Regularization (IGR) showed that a network could be fit to raw point clouds with a loss that makes the function vanish on the points and keeps its gradient at unit length. In 2021 NeuS learned SDFs from photographs by deriving a volume-rendering formulation that is unbiased to first order at the surface, and reported better Chamfer distance than IDR and NeRF on the DTU benchmark.

Compared with the alternatives, SDFs trade explicitness for convenience. Triangle meshes are what graphics hardware draws fastest, but they make topology changes and inside-outside queries awkward. Occupancy fields store only inside or outside, which loses the distance information that sphere tracing and collision tests use. Point clouds have no surface at all. Density fields such as the original NeRF render well, but the NeuS authors note that extracting high-quality surfaces from them is difficult because the representation has too few surface constraints. An SDF gives a well-defined surface, cheap inside tests, smooth normals from the gradient, and arbitrary topology, and a mesh can always be extracted with Marching Cubes when one is needed.

The limitations are concrete. A sign requires a closed shape; the DeepSDF authors note that human-made meshes are often not watertight and contain internal structures that must be cleaned before distances can be computed. Grid SDFs grow with the cube of resolution, which is why fusion systems truncate them. Neural SDFs are limited by the number of sample points and the network's capacity, and they must be evaluated many times per ray. Learned functions are not guaranteed to be true distances everywhere, which is why IGR and NeuS add an Eikonal term that pushes the gradient length toward one. Optimization can also be slow: NeuS trained each scene for 300,000 iterations, about 14 to 16 hours on a single NVIDIA RTX 2080 Ti GPU.

In practice the cost depends on the representation. Analytic SDFs cost almost nothing to store and run in real time in a fragment shader. Voxel SDFs need memory proportional to the grid size but allow constant-time lookups. Neural SDFs compress shapes well, as DeepSDF's 7.4 MB category model shows, but each query is a full network evaluation, so rendering and mesh extraction need a GPU and careful sampling.

04کام کی مثال

Sphere tracing a ray against a sphere SDF

  1. Define the scene as a sphere of radius 1 at the origin, so f(p) = length(p) - 1.

  2. Start a ray at o = (0, 0, -5) pointing along d = (0, 0, 1), with t = 0 and a hit threshold of 0.001.

  3. Evaluate f at (0, 0, -5): the distance is 5 - 1 = 4, so advance t to 4.

  4. Evaluate f at (0, 0, -1): the distance is 1 - 1 = 0, which is below the threshold, so report a hit at t = 4.

  5. Compute the normal as the normalized gradient of f at the hit point, which for a sphere is the hit position divided by its length, (0, 0, -1).

  6. Repeat with a ray offset sideways, such as o = (0.9, 0, -5), and count how many steps it takes as the ray grazes the sphere.

جو یہ دکھاتا ہے۔

A hit at distance 4 with normal pointing back toward the camera, found in two evaluations. Check it against the analytic ray-sphere intersection, which gives the same t = 4, and note that the grazing ray needs noticeably more steps because the distance values stay small near the silhouette.

حقیقی دنیا کا نفاذ

Shader artists build entire scenes from exact SDF primitives and combine them with min and max operators; Inigo Quilez's reference page lists the formulas and notes which operations keep distances exact.

Curless and Levoy's 1996 SIGGRAPH method merged up to 70 laser range scans into a cumulative weighted signed distance volume and extracted models of about 2.6 million triangles.

Microsoft Research's KinectFusion project, established in 2011, tracked a handheld depth camera and fused its frames into a 3D surface in real time, building on truncated SDF fusion.

DeepSDF (2019) trained one neural network to represent thousands of ShapeNet chair models in 7.4 MB, less than half the size of a single uncompressed 512-cubed voxel grid.

NeuS (2021) reconstructs object surfaces from ordinary photos by learning a neural SDF through volume rendering, evaluated on 15 DTU scenes with 49 or 64 images each.

دستخط شدہ فاصلاتی افعال کا مستقبل

Research since DeepSDF in 2019 has focused on making learned SDFs more accurate, faster and easier to train from ordinary data. IGR (2020) showed that a simple Eikonal regularizer can recover smooth surfaces from raw point clouds, and NeuS (2021) showed that photographs alone, without foreground masks, can supervise a neural SDF. Open problems named or implied in these papers include thin structures, non-watertight inputs, per-scene training times measured in hours, and the cost of evaluating a network many times along each ray. In graphics practice, analytic SDFs remain a staple of shader programming, and Inigo Quilez's reference continues to document which operators preserve exact distances. In scanning, the truncated SDF fusion approach that Curless and Levoy introduced in 1996 and KinectFusion ran in real time in 2011 remains a common baseline for depth-camera reconstruction. Whether future systems favor SDFs, density fields or explicit primitives for a given task is an active research question, and published benchmark results such as Chamfer distance on DTU are the reliable way to compare them.

اسے عملی جامہ پہنانا

یہ کیوں اہمیت رکھتا ہے۔

  • رفتار اور پیمانہ. بصری AI پیمانے پر معائنہ، پتہ لگانے، اور ٹیگنگ کے کاموں کو خودکار کر سکتا ہے۔
  • بلڈ کے انتخاب. تخلیقی ٹیمیں کم دستی ترمیم کے ساتھ تصورات کو تیزی سے پروٹو ٹائپ کر سکتی ہیں۔
  • ٹیم اور ورک فلو. آپریشنز امیج اور ویڈیو سگنلز کا استعمال کر سکتے ہیں جن پر کارروائی کرنا پہلے مشکل تھا۔

پر نگاہ رکھیں

  • تصویر کے حقوق اور رضامندی قانونی خطرات بن سکتے ہیں اگر ثبوت واضح نہ ہو۔
  • ماڈل کی کارکردگی روشنی، ڈیموگرافکس اور ماحول میں مختلف ہو سکتی ہے۔
  • جب تک اعتماد کی حدوں کی نگرانی نہ کی جائے غلط مثبتات پر کسی کا دھیان نہیں جا سکتا۔

اگلے اقدامات

  1. درستگی، یاد کرنے، اور غلطی کے اخراجات کے لیے قبولیت کے معیار کی وضاحت کریں۔
  2. اعداد و شمار کے ساتھ ٹیسٹ کریں جو حقیقی پیداوار کے حالات سے میل کھاتا ہے۔
  3. کم اعتماد یا زیادہ اثر والی پیشین گوئیوں کے لیے انسانی جائزہ شامل کریں۔
  4. کیمرہ یا ڈیٹاسیٹ کی تبدیلیوں کے بعد ماڈل ڈرفٹ کو ٹریک کریں اور دوبارہ تصدیق کریں۔

ذرائع اور مزید پڑھنا

  1. The Visual Computer (Springer)Sphere tracing: a geometric method for the antialiased ray tracing of implicit surfaces
  2. ACM SIGGRAPH History ArchiveA volumetric method for building complex models from range images
  3. Microsoft ResearchKinectFusion Project Page
  4. arXiv (Facebook Reality Labs)DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation
  5. arXiv (ICML 2020)Implicit Geometric Regularization for Learning Shapes
  6. arXiv (NeurIPS 2021)NeuS: Learning Neural Implicit Surfaces by Volume Rendering for Multi-view Reconstruction
  7. Inigo QuilezDistance functions

دریافت کرتے رہیں

مفت نیوز لیٹر

روزانہ AI بریفنگ حاصل کریں

ہر ہفتے کے دن صبح تین تصدیق شدہ AI کہانیاں، سادہ انگریزی میں لکھی گئیں۔ ہمیشہ کے لیے مفت، کوئی اشتہار نہیں۔

ہر ہفتے کے دن ایک ای میل۔ ایک کلک میں ان سبسکرائب کریں۔ ہم کبھی بھی آپ کا پتہ فروخت یا شیئر نہیں کرتے۔

اپنے آپ کو جانچیں۔

Take the Signed Distance Functions quiz

ہر جواب پر فوری فیڈبیک، اور کورس پاس کرنے کے بعد قابلِ تصدیق ID کے ساتھ شیئر کرنے کے قابل سرٹیفکیٹ۔

کوئز شروع کریں۔

مفت AI تعلیم کی حمایت کریں۔ AI Understanding ایک 501(c)(3) غیر منافع بخش ادارہ ہے — کوئی اشتہار نہیں، کوئی پے وال نہیں، کبھی نہیں۔ عطیہ کریں۔

اکثر پوچھے گئے سوالات

What is Signed Distance Functions?

A signed distance function (SDF) describes a shape by giving, for any point in space, the distance to the nearest surface, with a sign that says whether the point is inside or outside. The surface is wherever the value is zero. SDFs drive real-time ray-marched graphics, depth-camera 3D scanning and neural 3D reconstruction methods such as DeepSDF and NeuS.

دیئے گئے 3D پوائنٹ کے لیے دستخط شدہ فاصلاتی فنکشن کیا واپس کرتا ہے؟

ایک SDF قریب ترین سطح سے اس کے فاصلے تک کسی بھی نقطہ کا نقشہ بناتا ہے۔ نشان اشارہ کرتا ہے کہ نقطہ اندر (منفی) ہے یا باہر (مثبت)۔

SDF کی اصل سطح کہاں واقع ہے؟

سطح پوائنٹس کا سیٹ ہے جہاں دستخط شدہ فاصلہ بالکل صفر ہے، اندر اور باہر کے درمیان کی حد۔

Where does a true signed distance function satisfy the unit-gradient eikonal condition?

A true SDF has gradient magnitude one where it is differentiable, which holds almost everywhere; at nonsmooth points such as the medial axis, the gradient may be undefined.

اسفیئر ٹریسنگ SDF ویلیو کو کیسے استعمال کرتی ہے؟

چونکہ SDF قریب ترین سطح تک فاصلہ فراہم کرتا ہے، اس لیے ایک کرن بغیر کسی حد تک زیادہ شوٹنگ کے محفوظ طریقے سے آگے بڑھ سکتی ہے، اس وقت تک دہراتی ہے جب تک کہ یہ صفر تک نہ پہنچ جائے۔

ڈیپ ایس ڈی ایف ایک مخصوص شکل کی نمائندگی کرنے کے لیے کیا استعمال کرتا ہے؟

ڈیپ ایس ڈی ایف ہر شکل کو ایک کم جہتی اویکت ویکٹر کے طور پر انکوڈ کرتا ہے جو SDF کی پیشین گوئی کرنے والے نیٹ ورک کو کنڈیش کرتا ہے، کمپیکٹ، مسلسل شکلوں کو فعال کرتا ہے۔