{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,12,5]],"date-time":"2025-12-05T21:16:46Z","timestamp":1764969406006,"version":"3.46.0"},"reference-count":58,"publisher":"Association for Computing Machinery (ACM)","issue":"6","license":[{"start":{"date-parts":[[2025,12,4]],"date-time":"2025-12-04T00:00:00Z","timestamp":1764806400000},"content-version":"vor","delay-in-days":3,"URL":"http:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"funder":[{"name":"NSF","award":["2341952","2105806 and 2402583"],"award-info":[{"award-number":["2341952","2105806 and 2402583"]}]}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Graph."],"published-print":{"date-parts":[[2025,12]]},"abstract":"<jats:p>We present a novel method to differentiate integrals of discontinuous functions, which are common in inverse graphics, computer vision, and machine learning applications. Previous methods either require specialized routines to sample the discontinuous boundaries of predetermined primitives, or use reparameterization techniques that suffer from high variance. In contrast, our method handles general discontinuous functions, expressed as shader programs, without requiring manually specified boundary sampling routines. We achieve this through a program transformation that converts discontinuous functions into piecewise constant ones, enabling efficient boundary sampling through a novel segment snapping technique, and accurate derivatives at the boundary by simply comparing values on both sides of the discontinuity. Our method handles both explicit boundaries (polygons, ellipses, B\u00e9zier curves) and implicit ones (neural networks, noise-based functions, swept surfaces). We demonstrate that our system supports a wide range of applications, including painterly rendering, raster image fitting, constructive solid geometry, swept surfaces, mosaicing, and ray marching.<\/jats:p>","DOI":"10.1145\/3763291","type":"journal-article","created":{"date-parts":[[2025,12,4]],"date-time":"2025-12-04T17:15:39Z","timestamp":1764868539000},"page":"1-19","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":0,"title":["Automatic Sampling for Discontinuities in Differentiable Shaders"],"prefix":"10.1145","volume":"44","author":[{"ORCID":"https:\/\/orcid.org\/0009-0009-7070-2845","authenticated-orcid":false,"given":"Yash","family":"Belhe","sequence":"first","affiliation":[{"name":"University of California San Diego, San Diego, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0003-6360-168X","authenticated-orcid":false,"given":"Ishit","family":"Mehta","sequence":"additional","affiliation":[{"name":"University of California San Diego, San Diego, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-3833-3875","authenticated-orcid":false,"given":"Wesley","family":"Chang","sequence":"additional","affiliation":[{"name":"University of California San Diego, San Diego, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9655-2138","authenticated-orcid":false,"given":"Iliyan","family":"Georgiev","sequence":"additional","affiliation":[{"name":"Adobe Research, London, United Kingdom"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7622-4970","authenticated-orcid":false,"given":"Michael","family":"Gharbi","sequence":"additional","affiliation":[{"name":"Reve, San Francisco, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-3993-5789","authenticated-orcid":false,"given":"Ravi","family":"Ramamoorthi","sequence":"additional","affiliation":[{"name":"University of California San Diego, San Diego, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5443-470X","authenticated-orcid":false,"given":"Tzu-Mao","family":"Li","sequence":"additional","affiliation":[{"name":"University of California San Diego, San Diego, USA"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2025,12,4]]},"reference":[{"key":"e_1_2_1_1_1","unstructured":"Gaurav Arya Moritz Schauer Frank Sch\u00e4fer and Chris Rackauckas. 2022. Automatic differentiation of programs with discrete randomness. In Advances in Neural Information Processing Systems. Article 758 13 pages."},{"key":"e_1_2_1_2_1","doi-asserted-by":"crossref","unstructured":"Sai Bangaru Michael Gharbi Tzu-Mao Li Fujun Luan Kalyan Sunkavalli Milos Hasan Sai Bi Zexiang Xu Gilbert Bernstein and Fredo Durand. 2022. Differentiable Rendering of Neural SDFs through Reparameterization. Article 22 9 pages.","DOI":"10.1145\/3550469.3555397"},{"key":"e_1_2_1_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459775"},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3618353"},{"key":"e_1_2_1_5_1","article-title":"Unbiased Warped-Area Sampling for Differentiable Rendering","volume":"39","author":"Bangaru Sai Praveen","year":"2020","unstructured":"Sai Praveen Bangaru, Tzu-Mao Li, and Fr\u00e9do Durand. 2020. Unbiased Warped-Area Sampling for Differentiable Rendering. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 39, 6 (2020), 245:1\u2013245:18.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/3550454.3555484"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1016\/j.csda.2016.09.011"},{"key":"e_1_2_1_8_1","unstructured":"Quentin Berthet Mathieu Blondel Olivier Teboul Marco Cuturi Jean-Philippe Vert and Francis Bach. 2020. Learning with differentiable perturbed optimizers. In Advances in Neural Information Processing Systems. Article 797 12 pages."},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/3680528.3687606"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1145\/1806596.1806629"},{"key":"e_1_2_1_11_1","volume-title":"Distribution theoretic semantics for non-smooth differentiable programming. arXiv preprint arXiv:2207.05946","author":"Azevedo de Amorim Pedro H","year":"2022","unstructured":"Pedro H Azevedo de Amorim and Christopher Lam. 2022. Distribution theoretic semantics for non-smooth differentiable programming. arXiv preprint arXiv:2207.05946 (2022)."},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1109\/TPAMI.2011.33"},{"key":"e_1_2_1_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3651298"},{"key":"e_1_2_1_14_1","doi-asserted-by":"crossref","unstructured":"Michael Fischer and Tobias Ritschel. 2023. Plateau-Reduced Differentiable Path Tracing. In Computer Vision and Pattern Recognition. 4285\u20134294.","DOI":"10.1109\/CVPR52729.2023.00417"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.5555\/1455489"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/97879.97902"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1145\/383259.383327"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3197517.3201380"},{"key":"e_1_2_1_19_1","doi-asserted-by":"crossref","unstructured":"Aaron Hertzmann. 1998. Painterly rendering with curved brush strokes of multiple sizes. In SIGGRAPH. 453\u2013460.","DOI":"10.1145\/280814.280951"},{"key":"e_1_2_1_20_1","unstructured":"Wenzel Jakob S\u00e9bastien Speierer Nicolas Roussel Merlin Nimier-David Delio Vicini Tizian Zeltner Baptiste Nicolet Miguel Crespo Vincent Leroy and Ziyi Zhang. 2022. Mitsuba 3 renderer. https:\/\/mitsuba-renderer.org."},{"key":"e_1_2_1_21_1","volume-title":"Lee","author":"Kakade Sham M.","year":"2018","unstructured":"Sham M. Kakade and Jason D. Lee. 2018. Provably correct automatic subdifferentiation for qualified programs. In Advances in Neural Information Processing Systems. 7125\u20137135."},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/3528233.3530707"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1145\/3592433"},{"key":"e_1_2_1_24_1","doi-asserted-by":"publisher","DOI":"10.1109\/ACCESS.2023.3342136"},{"key":"e_1_2_1_25_1","article-title":"Modular Primitives for High-Performance Differentiable Rendering","volume":"39","author":"Laine Samuli","year":"2020","unstructured":"Samuli Laine, Janne Hellsten, Tero Karras, Yeongho Seol, Jaakko Lehtinen, and Timo Aila. 2020. Modular Primitives for High-Performance Differentiable Rendering. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 39, 6 (2020).","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_26_1","first-page":"20398","article-title":"Differentiable rendering with perturbed optimizers","volume":"34","author":"Lidec Quentin Le","year":"2021","unstructured":"Quentin Le Lidec, Ivan Laptev, Cordelia Schmid, and Justin Carpentier. 2021. Differentiable rendering with perturbed optimizers. In Advances in Neural Information Processing Systems, Vol. 34. 20398\u201320409.","journal-title":"Advances in Neural Information Processing Systems"},{"key":"e_1_2_1_27_1","unstructured":"Wonyeol Lee Hangyeol Yu Xavier Rival and Hongseok Yang. 2020. On Correctness of Automatic Differentiation for Non-Differentiable Functions. In Advances in Neural Information Processing Systems."},{"key":"e_1_2_1_28_1","unstructured":"Wonyeol Lee Hangyeol Yu and Hongseok Yang. 2018. Reparameterization gradient for non-differentiable models. In Advances in Neural Information Processing Systems. 5553\u20135563."},{"key":"e_1_2_1_29_1","volume-title":"Proc. ACM Program. Lang. 7, POPL, Article 5","author":"Lew Alexander K.","year":"2023","unstructured":"Alexander K. Lew, Mathieu Huot, Sam Staton, and Vikash K. Mansinghka. 2023. ADEV: Sound Automatic Differentiation of Expected Values of Probabilistic Programs. Proc. ACM Program. Lang. 7, POPL, Article 5 (2023), 33 pages."},{"key":"e_1_2_1_30_1","article-title":"Differentiable Monte Carlo Ray Tracing through Edge Sampling","volume":"37","author":"Li Tzu-Mao","year":"2018","unstructured":"Tzu-Mao Li, Miika Aittala, Fr\u00e9do Durand, and Jaakko Lehtinen. 2018. Differentiable Monte Carlo Ray Tracing through Edge Sampling. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 37, 6 (2018), 222:1\u2013222:11.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_31_1","article-title":"Differentiable Vector Graphics Rasterization for Editing and Learning","volume":"39","author":"Li Tzu-Mao","year":"2020","unstructured":"Tzu-Mao Li, Michal Luk\u00e1\u010d, Gharbi Micha\u00ebl, and Jonathan Ragan-Kelley. 2020. Differentiable Vector Graphics Rasterization for Editing and Learning. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 39, 6 (2020), 193:1\u2013193:15.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_32_1","doi-asserted-by":"crossref","unstructured":"Selena Ling Abhishek Madan Nicholas Sharp and Alec Jacobson. 2025. Uniform Sampling of Surfaces by Casting Rays. arXiv:2506.05268 [cs.GR] https:\/\/arxiv.org\/abs\/2506.05268","DOI":"10.1111\/cgf.70202"},{"key":"e_1_2_1_33_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICCV.2019.00780"},{"key":"e_1_2_1_34_1","first-page":"228","article-title":"Reparameterizing discontinuous integrands for differentiable rendering","volume":"38","author":"Loubet Guillaume","year":"2019","unstructured":"Guillaume Loubet, Nicolas Holzschuch, and Wenzel Jakob. 2019. Reparameterizing discontinuous integrands for differentiable rendering. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 38, 6 (2019), 228.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_35_1","doi-asserted-by":"publisher","DOI":"10.1016\/0047-259X(79)90065-4"},{"key":"e_1_2_1_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3649843"},{"key":"e_1_2_1_37_1","doi-asserted-by":"publisher","DOI":"10.1109\/CVPR52733.2024.00017"},{"key":"e_1_2_1_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/1618452.1618502"},{"key":"e_1_2_1_39_1","first-page":"1","article-title":"Monte Carlo Gradient Estimation in Machine Learning","volume":"21","author":"Mohamed Shakir","year":"2020","unstructured":"Shakir Mohamed, Mihaela Rosca, Michael Figurnov, and Andriy Mnih. 2020. Monte Carlo Gradient Estimation in Machine Learning. J. Mach. Learn. Res. 21, 132 (2020), 1\u201362.","journal-title":"J. Mach. Learn. Res."},{"key":"e_1_2_1_40_1","doi-asserted-by":"publisher","DOI":"10.1145\/3478513.3480501"},{"key":"e_1_2_1_41_1","volume-title":"NIPS Autodiff Workshop.","author":"Paszke Adam","year":"2017","unstructured":"Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. 2017. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop."},{"key":"e_1_2_1_42_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10791-009-9124-x"},{"key":"e_1_2_1_43_1","volume-title":"Evolutionsstrategie: Optimierung technischer Systeme nach Prinzipien der biologischen Evolution","author":"Rechenberg Ingo","year":"1973","unstructured":"Ingo Rechenberg and Manfred Eigen. 1973. Evolutionsstrategie: Optimierung technischer Systeme nach Prinzipien der biologischen Evolution. Frommann-Holzboog Verlag."},{"key":"e_1_2_1_44_1","volume-title":"Arthur William Brightmore, and William Henry Moorby","author":"Reynolds Osborne","year":"1903","unstructured":"Osborne Reynolds, Arthur William Brightmore, and William Henry Moorby. 1903. The sub-mechanics of the universe. Vol. 3. University Press."},{"key":"e_1_2_1_45_1","volume-title":"Variational optimization. arXiv preprint arXiv:1212.4507","author":"Staines Joe","year":"2012","unstructured":"Joe Staines and David Barber. 2012. Variational optimization. arXiv preprint arXiv:1212.4507 (2012)."},{"key":"e_1_2_1_46_1","doi-asserted-by":"crossref","DOI":"10.1007\/978-981-16-8193-6","volume-title":"International Conference on Machine Learning","volume":"162","author":"Suh Hyung Ju","year":"2022","unstructured":"Hyung Ju Suh, Max Simchowitz, Kaiqing Zhang, and Russ Tedrake. 2022. Do Differentiable Simulators Give Better Policy Gradients?. In International Conference on Machine Learning, Vol. 162. 20668\u201320696."},{"key":"e_1_2_1_47_1","doi-asserted-by":"publisher","DOI":"10.1145\/3528223.3530139"},{"key":"e_1_2_1_48_1","unstructured":"Peng Wang Lingjie Liu Yuan Liu Christian Theobalt Taku Komura and Wenping Wang. 2021. NeuS: Learning Neural Implicit Surfaces by Volume Rendering for Multi-view Reconstruction. NeurIPS (2021)."},{"key":"e_1_2_1_49_1","doi-asserted-by":"publisher","DOI":"10.1145\/3680528.3687573"},{"key":"e_1_2_1_50_1","article-title":"Warped-Area Reparameterization of Differential Path Integrals","volume":"42","author":"Xu Peiyu","year":"2023","unstructured":"Peiyu Xu, Sai Bangaru, Tzu-Mao Li, and Shuang Zhao. 2023. Warped-Area Reparameterization of Differential Path Integrals. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 42, 6, Article 213 (2023), 18 pages.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_51_1","unstructured":"Peiyu Xu Sai Bangaru Tzu-Mao Li and Shuang Zhao. 2024. Markov-Chain Monte Carlo Sampling of Visibility Boundaries for Differentiable Rendering. Article 118 11 pages."},{"key":"e_1_2_1_52_1","doi-asserted-by":"publisher","DOI":"10.1145\/3528223.3530080"},{"key":"e_1_2_1_53_1","volume-title":"A\u03b4: Autodiff for Discontinuous Programs - Applied to Shaders. ACM Trans. Graph. (Proc. SIGGRAPH)","author":"Yang Yuting","year":"2022","unstructured":"Yuting Yang, Connelly Barnes, Andrew Adams, and Adam Finkelstein. 2022. A\u03b4: Autodiff for Discontinuous Programs - Applied to Shaders. ACM Trans. Graph. (Proc. SIGGRAPH) (2022)."},{"key":"e_1_2_1_54_1","volume-title":"Thirty-Fifth Conference on Neural Information Processing Systems.","author":"Yariv Lior","year":"2021","unstructured":"Lior Yariv, Jiatao Gu, Yoni Kasten, and Yaron Lipman. 2021. Volume rendering of neural implicit surfaces. In Thirty-Fifth Conference on Neural Information Processing Systems."},{"key":"e_1_2_1_55_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459807"},{"key":"e_1_2_1_56_1","doi-asserted-by":"publisher","DOI":"10.1145\/3386569.3392383"},{"key":"e_1_2_1_57_1","article-title":"Projective Sampling for Differentiable Rendering of Geometry","volume":"42","author":"Zhang Ziyi","year":"2023","unstructured":"Ziyi Zhang, Nicolas Roussel, and Wenzel Jakob. 2023. Projective Sampling for Differentiable Rendering of Geometry. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 42, 6, Article 212 (2023), 14 pages.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_1_58_1","doi-asserted-by":"crossref","unstructured":"Shuang Zhao Wenzel Jakob and Tzu-Mao Li. 2020. Physics-Based Differentiable Rendering: From Theory to Implementation. In SIGGRAPH Courses. Article 14 30 pages.","DOI":"10.1145\/3388769.3407454"}],"container-title":["ACM Transactions on Graphics"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3763291","content-type":"application\/pdf","content-version":"vor","intended-application":"syndication"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3763291","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,12,5]],"date-time":"2025-12-05T21:13:01Z","timestamp":1764969181000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3763291"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,12]]},"references-count":58,"journal-issue":{"issue":"6","published-print":{"date-parts":[[2025,12]]}},"alternative-id":["10.1145\/3763291"],"URL":"https:\/\/doi.org\/10.1145\/3763291","relation":{},"ISSN":["0730-0301","1557-7368"],"issn-type":[{"type":"print","value":"0730-0301"},{"type":"electronic","value":"1557-7368"}],"subject":[],"published":{"date-parts":[[2025,12]]},"assertion":[{"value":"2025-05-23","order":0,"name":"received","label":"Received","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-08-09","order":2,"name":"accepted","label":"Accepted","group":{"name":"publication_history","label":"Publication History"}},{"value":"2025-12-04","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}