Knowledge

Signed distance function

Source 📝

988: 51: 31: 915: 500: 1053:
to minimise the error in interpenetration of pixels while rendering multiple objects. In particular, for any pixel that does not belong to an object, if it lies outside the object in rendition, no penalty is imposed; if it does, a positive value proportional to its distance inside the object is
1171: 118:
approaches the boundary of Ω where the signed distance function is zero, and it takes negative values outside of Ω. However, the alternative convention is also sometimes taken instead (i.e., negative inside Ω and positive outside). The concept also sometimes goes by the name
739: 373: 303: 1060: 1188:(SDFGI), that became a compromise between more realistic voxel-based GI and baked GI. Its core advantage is that it can be applied to infinite space, which allows developers to use it for open-world games. 1034:
in order to avoid the computational complexity of solving the problem in the (continuous) vector space. The rendered text often loses sharp corners. In 2014, an improved method was presented by
664: 215: 178: 578: 1475:
Izadi, Shahram; Kim, David; Hilliges, Otmar; Molyneaux, David; Newcombe, Richard; Kohli, Pushmeet; Shotton, Jamie; Hodges, Steve; Freeman, Dustin (2011). "KinectFusion".
1434:
Perera, S.; Barnes, N.; He, X.; Izadi, S.; Kohli, P.; Glocker, B. (January 2015). "Motion Segmentation of Truncated Signed Distance Function Based Volumetric Surfaces".
365: 1597:
Jiang, Wen; Kolotouros, Nikos; Pavlakos, Georgios; Zhou, Xiaowei; Daniilidis, Kostas (2020-06-15). "Coherent Reconstruction of Multiple Humans from a Single Image".
326: 910:{\displaystyle \int _{T(\partial \Omega ,\mu )}g(x)\,dx=\int _{\partial \Omega }\int _{-\mu }^{\mu }g(u+\lambda N(u))\,\det(I-\lambda W_{u})\,d\lambda \,dS_{u},} 495:{\displaystyle f(x)={\begin{cases}d(x,\partial \Omega )&{\text{if }}x\in \Omega \\-d(x,\partial \Omega )&{\text{if }}\,x\notin \Omega .\end{cases}}} 227: 1191:
In 2023, a "GPUI" UI framework was released to draw all UI elements using the GPU, many parts using SDF. The author claims to have produced a
1451: 1418: 1166:{\displaystyle f(x)={\begin{cases}0&{\text{if }}\,x\in \Omega ^{c}\\d(x,\partial \Omega )&{\text{if }}\,x\in \Omega \end{cases}}} 1671: 1543: 1492: 682: 1198:
that renders at 120 fps. The work makes use of Inigo Quilez's list of geometric primitives in SDF, Evan Wallace (co-founder of
730: 701:
for the Jacobian of changing variables in terms of the signed distance function and nearest boundary point. Specifically, if
1177: 1619: 1700: 1366: 1710: 677:
field. The signed distance function is thus a differentiable extension of the normal vector field. In particular, the
592: 1294:
Malladi, R.; Sethian, J.A.; Vemuri, B.C. (1995). "Shape modeling with front propagation: a level set approach".
692:
is twice continuously differentiable on it, then there is an explicit formula involving the Weingarten map
1521: 1303: 107: 718: 619: 197: 160: 1380: 957: 953: 149: 1526: 1516:
Green, Chris (2007). "Improved alpha-tested magnification for vector textures and special effects".
1084: 397: 1308: 1185: 1181: 1011: 996: 544: 181: 103: 83: 75: 35: 1598: 1580: 1549: 1498: 1457: 1321: 95: 43: 1685:. Grundlehren der mathematischen Wissenschaften. Vol. 224 (2nd ed.). Springer-Verlag. 1705: 1667: 1539: 1488: 1447: 1414: 1236: 1215: 1015: 976: 528: 87: 350: 1531: 1480: 1439: 1313: 1276: 1225: 1220: 1199: 987: 972: 961: 938: 536: 54:
A more complicated set (top) and the graph of its signed distance function (bottom, in red).
311: 1570:
GLyphy: high-quality glyph rendering using OpenGL ES2 shaders [linux.conf.au 2014]
1035: 1031: 1004: 524: 514: 1039: 1246: 1230: 1043: 678: 1477:
Proceedings of the 24th annual ACM symposium on User interface software and technology
1694: 1251: 1203: 1050: 1019: 674: 1461: 1553: 1502: 1362: 1325: 1000: 140: 91: 1661: 1408: 1241: 1195: 1023: 925: 59: 1275:. IEEE Computer Society Conference on Computer Vision and Pattern Recognition. 991:
Signed distance fields stored as raster images can be used to represent shapes.
50: 30: 17: 1568: 1639:"Leveraging Rust and the GPU to render user interfaces at 120 FPS - Zed Blog" 1535: 1484: 949: 521: 1443: 1280: 298:{\displaystyle d(x,\partial \Omega )=\inf _{y\in \partial \Omega }d(x,y),} 1381:"Optimization Methods for Direct Volume Rendering on the Client Side Web" 532: 1014:, usually in a raymarching context, starting in the mid 2000s. By 2007, 688:
If, further, Γ is a region sufficiently close to the boundary of Ω that
1575: 1030:
acceleration in its games. Valve's method is not perfect as it runs in
329: 1317: 136: 1603: 1585: 952:
for calculating the signed distance function include the efficient
1046:
techniques (which culls too-far-away points) to run in real time.
986: 968: 603:
on points sufficiently close to the boundary of Ω. In particular,
49: 38:(bottom, in red) of the signed distance between the points on the 29: 1638: 1407:
Tomas Akenine-Möller; Eric Haines; Naty Hoffman (6 August 2018).
1369:. Mathematics of Computation, 2005, 74. Jg., Nr. 250, S. 603-627. 681:
of the signed distance function on the boundary of Ω gives the
1436:
2015 IEEE Winter Conference on Applications of Computer Vision
1296:
IEEE Transactions on Pattern Analysis and Machine Intelligence
1027: 527:
boundary, then the signed distance function is differentiable
1159: 488: 1620:"Godot 4.0 gets SDF based real-time global illumination" 1683:
Elliptic Partial Differential Equations of Second Order
995:
Signed distance functions are applied, for example, in
971:
rendering, a fast algorithm for calculating the SDF in
1479:. UIST '11. New York, NY, USA: ACM. pp. 559–568. 1063: 742: 622: 547: 376: 353: 314: 230: 200: 163: 94:(such as the surface of a geometric shape), with the 1165: 909: 658: 572: 494: 359: 320: 297: 209: 172: 1010:SDF has been used to describe object geometry in 1350: 1338: 855: 315: 256: 1663:Level Set Methods and Dynamic Implicit Surfaces 1660:Stanley J. Osher and Ronald P. Fedkiw (2003). 1049:A modified version of SDF was introduced as a 27:Distance from a point to the boundary of a set 1018:is using SDFs to render large pixel-size (or 8: 1367:A fast sweeping method for eikonal equations 1042:with arc splines, accelerated by grid-based 1038:. Behdad's GLyphy approximates the font's 1602: 1525: 1307: 1206:in SDF, and a new rounded rectangle SDF. 1146: 1141: 1108: 1097: 1092: 1079: 1062: 898: 890: 883: 874: 854: 818: 810: 797: 783: 747: 741: 621: 559: 548: 546: 472: 467: 423: 392: 375: 352: 313: 259: 229: 199: 162: 1273:Level set based shape prior segmentation 1263: 713:) is the set of points within distance 1681:Gilbarg, D.; Trudinger, N. S. (1983). 1687:(or the Appendix of the 1977 1st ed.) 7: 1637:Scandurra, Antonio (7 March 2023). 1410:Real-Time Rendering, Fourth Edition 114:inside Ω, it decreases in value as 1153: 1133: 1130: 1105: 801: 798: 757: 754: 623: 553: 479: 459: 456: 434: 415: 412: 354: 269: 266: 246: 243: 204: 201: 167: 164: 46:(also represented on top, in gray) 25: 937:indicates that we are taking the 659:{\displaystyle \nabla f(x)=N(x),} 1583:from the original on 2021-12-11. 210:{\displaystyle \partial \Omega } 173:{\displaystyle \partial \Omega } 121:oriented distance function/field 717:of the boundary of Ω (i.e. the 184:. The distance between a point 1388:Digitala Vetenskapliga Arkivet 1136: 1121: 1073: 1067: 880: 858: 851: 848: 842: 827: 780: 774: 766: 751: 731:absolutely integrable function 650: 644: 635: 629: 560: 549: 462: 447: 418: 403: 386: 380: 289: 277: 249: 234: 110:has positive values at points 1: 1184:received SDF-based real-time 999:, for instance the method of 573:{\displaystyle |\nabla f|=1.} 509:Properties in Euclidean space 98:determined by whether or not 1351:Gilbarg & Trudinger 1983 1339:Gilbarg & Trudinger 1983 1233:(also known as offset curve) 42:plane (in blue) and a fixed 1727: 1271:Chan, T.; Zhu, W. (2005). 62:and its applications, the 1518:ACM SIGGRAPH 2007 courses 593:Differentiability classes 1379:Nilsson, Tobias (2019). 583:If the boundary of Ω is 513:If Ω is a subset of the 337:signed distance function 64:signed distance function 1536:10.1145/1281500.1281665 1485:10.1145/2047196.2047270 360:{\displaystyle \Omega } 221:is defined as usual as 1438:. pp. 1046–1053. 1167: 992: 911: 660: 574: 496: 361: 322: 299: 211: 174: 55: 47: 1444:10.1109/WACV.2015.144 1281:10.1109/CVPR.2005.212 1168: 990: 960:and the more general 912: 719:tubular neighbourhood 661: 575: 497: 362: 323: 321:{\displaystyle \inf } 300: 212: 175: 68:signed distance field 53: 33: 1061: 958:fast sweeping method 954:fast marching method 740: 620: 545: 374: 351: 312: 228: 198: 161: 1701:Applied mathematics 1353:, Equation (14.98). 1186:global illumination 1012:real-time rendering 997:real-time rendering 823: 76:orthogonal distance 1711:Sign (mathematics) 1163: 1158: 993: 977:summed-area tables 907: 806: 656: 570: 492: 487: 357: 318: 295: 273: 207: 170: 56: 48: 1567:Behdad Esfahbod. 1520:. pp. 9–18. 1453:978-1-4799-6683-7 1420:978-1-351-81615-1 1318:10.1109/34.368173 1237:Signed arc length 1216:Distance function 1202:)'s approximated 1144: 1095: 529:almost everywhere 470: 426: 255: 78:of a given point 16:(Redirected from 1718: 1686: 1677: 1647: 1646: 1634: 1628: 1627: 1615: 1609: 1608: 1606: 1594: 1588: 1584: 1564: 1558: 1557: 1529: 1513: 1507: 1506: 1472: 1466: 1465: 1431: 1425: 1424: 1404: 1398: 1397: 1395: 1394: 1385: 1376: 1370: 1360: 1354: 1348: 1342: 1336: 1330: 1329: 1311: 1291: 1285: 1284: 1268: 1226:Eikonal equation 1221:Level-set method 1172: 1170: 1169: 1164: 1162: 1161: 1145: 1142: 1113: 1112: 1096: 1093: 1001:SDF ray marching 973:taxicab geometry 962:level-set method 939:surface integral 923: 916: 914: 913: 908: 903: 902: 879: 878: 822: 817: 805: 804: 770: 769: 665: 663: 662: 657: 579: 577: 576: 571: 563: 552: 537:eikonal equation 501: 499: 498: 493: 491: 490: 471: 468: 427: 424: 366: 364: 363: 358: 346: 342: 327: 325: 324: 319: 304: 302: 301: 296: 272: 220: 216: 214: 213: 208: 193: 187: 179: 177: 176: 171: 156: 147: 134: 21: 1726: 1725: 1721: 1720: 1719: 1717: 1716: 1715: 1691: 1690: 1680: 1674: 1659: 1656: 1651: 1650: 1636: 1635: 1631: 1618:Engine, Godot. 1617: 1616: 1612: 1596: 1595: 1591: 1566: 1565: 1561: 1546: 1527:10.1.1.170.9418 1515: 1514: 1510: 1495: 1474: 1473: 1469: 1454: 1433: 1432: 1428: 1421: 1406: 1405: 1401: 1392: 1390: 1383: 1378: 1377: 1373: 1361: 1357: 1349: 1345: 1337: 1333: 1293: 1292: 1288: 1270: 1269: 1265: 1260: 1212: 1157: 1156: 1139: 1115: 1114: 1104: 1090: 1080: 1059: 1058: 1036:Behdad Esfahbod 1005:computer vision 985: 947: 936: 921: 894: 870: 793: 743: 738: 737: 700: 618: 617: 543: 542: 515:Euclidean space 511: 505: 486: 485: 465: 438: 437: 421: 393: 372: 371: 349: 348: 344: 340: 310: 309: 226: 225: 218: 196: 195: 194:and the subset 189: 185: 159: 158: 152: 143: 132: 129: 28: 23: 22: 18:Signed distance 15: 12: 11: 5: 1724: 1722: 1714: 1713: 1708: 1703: 1693: 1692: 1689: 1688: 1678: 1672: 1655: 1652: 1649: 1648: 1629: 1610: 1589: 1559: 1544: 1508: 1493: 1467: 1452: 1426: 1419: 1399: 1371: 1355: 1343: 1341:, Lemma 14.16. 1331: 1309:10.1.1.33.2443 1302:(2): 158–175. 1286: 1262: 1261: 1259: 1256: 1255: 1254: 1249: 1247:Signed measure 1244: 1239: 1234: 1231:Parallel curve 1228: 1223: 1218: 1211: 1208: 1174: 1173: 1160: 1155: 1152: 1149: 1140: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1116: 1111: 1107: 1103: 1100: 1091: 1089: 1086: 1085: 1083: 1078: 1075: 1072: 1069: 1066: 1044:discretization 984: 981: 946: 943: 932: 918: 917: 906: 901: 897: 893: 889: 886: 882: 877: 873: 869: 866: 863: 860: 857: 853: 850: 847: 844: 841: 838: 835: 832: 829: 826: 821: 816: 813: 809: 803: 800: 796: 792: 789: 786: 782: 779: 776: 773: 768: 765: 762: 759: 756: 753: 750: 746: 696: 683:Weingarten map 673:is the inward 667: 666: 655: 652: 649: 646: 643: 640: 637: 634: 631: 628: 625: 581: 580: 569: 566: 562: 558: 555: 551: 535:satisfies the 510: 507: 503: 502: 489: 484: 481: 478: 475: 466: 464: 461: 458: 455: 452: 449: 446: 443: 440: 439: 436: 433: 430: 422: 420: 417: 414: 411: 408: 405: 402: 399: 398: 396: 391: 388: 385: 382: 379: 367:is defined by 356: 317: 306: 305: 294: 291: 288: 285: 282: 279: 276: 271: 268: 265: 262: 258: 254: 251: 248: 245: 242: 239: 236: 233: 206: 203: 169: 166: 128: 125: 26: 24: 14: 13: 10: 9: 6: 4: 3: 2: 1723: 1712: 1709: 1707: 1704: 1702: 1699: 1698: 1696: 1684: 1679: 1675: 1673:9780387227467 1669: 1665: 1664: 1658: 1657: 1653: 1644: 1640: 1633: 1630: 1625: 1621: 1614: 1611: 1605: 1600: 1593: 1590: 1587: 1582: 1578: 1577: 1572: 1571: 1563: 1560: 1555: 1551: 1547: 1545:9781450318235 1541: 1537: 1533: 1528: 1523: 1519: 1512: 1509: 1504: 1500: 1496: 1494:9781450307161 1490: 1486: 1482: 1478: 1471: 1468: 1463: 1459: 1455: 1449: 1445: 1441: 1437: 1430: 1427: 1422: 1416: 1413:. CRC Press. 1412: 1411: 1403: 1400: 1389: 1382: 1375: 1372: 1368: 1364: 1359: 1356: 1352: 1347: 1344: 1340: 1335: 1332: 1327: 1323: 1319: 1315: 1310: 1305: 1301: 1297: 1290: 1287: 1282: 1278: 1274: 1267: 1264: 1257: 1253: 1252:Signed volume 1250: 1248: 1245: 1243: 1240: 1238: 1235: 1232: 1229: 1227: 1224: 1222: 1219: 1217: 1214: 1213: 1209: 1207: 1205: 1204:gaussian blur 1201: 1197: 1194: 1189: 1187: 1183: 1179: 1176:In 2020, the 1150: 1147: 1127: 1124: 1118: 1109: 1101: 1098: 1087: 1081: 1076: 1070: 1064: 1057: 1056: 1055: 1052: 1051:loss function 1047: 1045: 1041: 1040:Bézier curves 1037: 1033: 1029: 1025: 1021: 1017: 1013: 1008: 1006: 1002: 998: 989: 982: 980: 978: 974: 970: 965: 963: 959: 955: 951: 944: 942: 940: 935: 931: 927: 904: 899: 895: 891: 887: 884: 875: 871: 867: 864: 861: 845: 839: 836: 833: 830: 824: 819: 814: 811: 807: 794: 790: 787: 784: 777: 771: 763: 760: 748: 744: 736: 735: 734: 732: 728: 724: 720: 716: 712: 708: 704: 699: 695: 691: 686: 684: 680: 676: 675:normal vector 672: 653: 647: 641: 638: 632: 626: 616: 615: 614: 612: 609:the boundary 608: 607: 602: 598: 594: 590: 586: 567: 564: 556: 541: 540: 539: 538: 534: 530: 526: 523: 519: 516: 508: 506: 482: 476: 473: 453: 450: 444: 441: 431: 428: 409: 406: 400: 394: 389: 383: 377: 370: 369: 368: 339:from a point 338: 333: 331: 292: 286: 283: 280: 274: 263: 260: 252: 240: 237: 231: 224: 223: 222: 192: 183: 155: 151: 146: 142: 138: 126: 124: 122: 117: 113: 109: 105: 101: 97: 93: 89: 85: 81: 77: 73: 69: 65: 61: 52: 45: 41: 37: 32: 19: 1682: 1666:. Springer. 1662: 1642: 1632: 1624:Godot Engine 1623: 1613: 1592: 1574: 1569: 1562: 1517: 1511: 1476: 1470: 1435: 1429: 1409: 1402: 1391:. Retrieved 1387: 1374: 1363:Zhao Hongkai 1358: 1346: 1334: 1299: 1295: 1289: 1272: 1266: 1192: 1190: 1180:game engine 1175: 1048: 1032:raster space 1024:smooth fonts 1009: 994: 983:Applications 966: 948: 933: 929: 924:denotes the 919: 726: 722: 714: 710: 706: 702: 697: 693: 689: 687: 670: 668: 610: 605: 604: 600: 596: 588: 584: 582: 517: 512: 504: 336: 334: 328:denotes the 307: 190: 153: 144: 141:metric space 130: 120: 115: 111: 99: 92:metric space 79: 71: 67: 63: 57: 39: 1586:Source Code 1242:Signed area 1196:code editor 926:determinant 733:on Γ, then 60:mathematics 1695:Categories 1654:References 1604:2006.08586 1393:2022-07-08 950:Algorithms 945:Algorithms 721:of radius 613:satisfies 531:, and its 127:Definition 106:of Ω. The 102:is in the 1522:CiteSeerX 1304:CiteSeerX 1182:Godot 4.0 1154:Ω 1151:∈ 1134:Ω 1131:∂ 1106:Ω 1102:∈ 1054:imposed. 888:λ 868:λ 865:− 837:λ 820:μ 815:μ 812:− 808:∫ 802:Ω 799:∂ 795:∫ 764:μ 758:Ω 755:∂ 745:∫ 624:∇ 591:≥ 2 (see 554:∇ 522:piecewise 480:Ω 477:∉ 460:Ω 457:∂ 442:− 435:Ω 432:∈ 416:Ω 413:∂ 355:Ω 270:Ω 267:∂ 264:∈ 247:Ω 244:∂ 205:Ω 202:∂ 168:Ω 165:∂ 74:) is the 1706:Distance 1581:Archived 1462:16811314 1210:See also 1143:if  1094:if  1020:high DPI 533:gradient 469:if  425:if  182:boundary 108:function 104:interior 84:boundary 1576:YouTube 1554:7479538 1503:3345516 1326:9505101 725:), and 679:Hessian 595:) then 330:infimum 180:be its 90:Ω in a 82:to the 1670:  1552:  1542:  1524:  1501:  1491:  1460:  1450:  1417:  1324:  1306:  1003:, and 920:where 729:is an 669:where 525:smooth 308:where 157:, and 150:metric 137:subset 1599:arXiv 1550:S2CID 1499:S2CID 1458:S2CID 1384:(PDF) 1322:S2CID 1258:Notes 1200:Figma 1026:with 1016:Valve 975:uses 969:voxel 520:with 148:with 139:of a 135:be a 86:of a 36:graph 1668:ISBN 1540:ISBN 1489:ISBN 1448:ISBN 1415:ISBN 1178:FOSS 967:For 928:and 587:for 335:The 131:Let 96:sign 44:disk 34:The 1643:Zed 1532:doi 1481:doi 1440:doi 1314:doi 1277:doi 1193:Zed 1028:GPU 922:det 856:det 709:Ω, 599:is 347:to 343:of 316:inf 257:inf 217:of 188:of 88:set 72:SDF 66:or 58:In 1697:: 1641:. 1622:. 1579:. 1573:. 1548:. 1538:. 1530:. 1497:. 1487:. 1456:. 1446:. 1386:. 1365:. 1320:. 1312:. 1300:17 1298:. 1022:) 1007:. 979:. 964:. 956:, 941:. 930:dS 685:. 606:on 568:1. 332:. 123:. 40:xy 1676:. 1645:. 1626:. 1607:. 1601:: 1556:. 1534:: 1505:. 1483:: 1464:. 1442:: 1423:. 1396:. 1328:. 1316:: 1283:. 1279:: 1148:x 1137:) 1128:, 1125:x 1122:( 1119:d 1110:c 1099:x 1088:0 1082:{ 1077:= 1074:) 1071:x 1068:( 1065:f 934:u 905:, 900:u 896:S 892:d 885:d 881:) 876:u 872:W 862:I 859:( 852:) 849:) 846:u 843:( 840:N 834:+ 831:u 828:( 825:g 791:= 788:x 785:d 781:) 778:x 775:( 772:g 767:) 761:, 752:( 749:T 727:g 723:μ 715:μ 711:μ 707:∂ 705:( 703:T 698:x 694:W 690:f 671:N 654:, 651:) 648:x 645:( 642:N 639:= 636:) 633:x 630:( 627:f 611:f 601:C 597:d 589:k 585:C 565:= 561:| 557:f 550:| 518:R 483:. 474:x 463:) 454:, 451:x 448:( 445:d 429:x 419:) 410:, 407:x 404:( 401:d 395:{ 390:= 387:) 384:x 381:( 378:f 345:X 341:x 293:, 290:) 287:y 284:, 281:x 278:( 275:d 261:y 253:= 250:) 241:, 238:x 235:( 232:d 219:X 191:X 186:x 154:d 145:X 133:Ω 116:x 112:x 100:x 80:x 70:( 20:)

Index

Signed distance

graph
disk

mathematics
orthogonal distance
boundary
set
metric space
sign
interior
function
subset
metric space
metric
boundary
infimum
Euclidean space
piecewise
smooth
almost everywhere
gradient
eikonal equation
Differentiability classes
normal vector
Hessian
Weingarten map
tubular neighbourhood
absolutely integrable function

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.