{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,28]],"date-time":"2026-03-28T08:16:48Z","timestamp":1774685808693,"version":"3.50.1"},"reference-count":39,"publisher":"Association for Computing Machinery (ACM)","issue":"4","license":[{"start":{"date-parts":[[2022,7,1]],"date-time":"2022-07-01T00:00:00Z","timestamp":1656633600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by-nc-nd\/4.0\/"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["ACM Trans. Graph."],"published-print":{"date-parts":[[2022,7]]},"abstract":"<jats:p>\n            Over the last decade, automatic differentiation (AD) has profoundly impacted graphics and vision applications --- both broadly via deep learning and specifically for inverse rendering. Traditional AD methods ignore gradients at discontinuities, instead treating functions as continuous. Rendering algorithms intrinsically rely on discontinuities, crucial at object silhouettes and in general for any branching operation. Researchers have proposed\n            <jats:italic>fully-<\/jats:italic>\n            automatic differentiation approaches for handling discontinuities by restricting to affine functions, or\n            <jats:italic>semi-<\/jats:italic>\n            automatic processes restricted either to invertible functions or to specialized applications like vector graphics. This paper describes a compiler-based approach to extend reverse mode AD so as to accept arbitrary programs involving discontinuities. Our novel gradient rules generalize differentiation to work correctly, assuming there is a single discontinuity in a local neighborhood, by approximating the prefiltered gradient over a box kernel oriented along a 1D sampling axis. We describe when such approximation rules are first-order correct, and show that this correctness criterion applies to a relatively broad class of functions. Moreover, we show that the method is effective in practice for arbitrary programs, including features for which we cannot prove correctness. We evaluate this approach on procedural shader programs, where the task is to optimize unknown parameters in order to match a target image, and our method outperforms baselines in terms of both convergence and efficiency. Our compiler outputs gradient programs in TensorFlow, PyTorch (for quick prototypes) and Halide with an optional auto-scheduler (for efficiency). The compiler also outputs GLSL that renders the target image, allowing users to interactively modify and animate the shader, which would otherwise be cumbersome in other representations such as triangle meshes or vector art.\n          <\/jats:p>","DOI":"10.1145\/3528223.3530125","type":"journal-article","created":{"date-parts":[[2022,7,22]],"date-time":"2022-07-22T21:06:27Z","timestamp":1658523987000},"page":"1-24","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":17,"title":["A\n            <i>\u03b4<\/i>"],"prefix":"10.1145","volume":"41","author":[{"given":"Yuting","family":"Yang","sequence":"first","affiliation":[{"name":"Princeton University"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Connelly","family":"Barnes","sequence":"additional","affiliation":[{"name":"Adobe Research"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Andrew","family":"Adams","sequence":"additional","affiliation":[{"name":"Adobe Research"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"given":"Adam","family":"Finkelstein","sequence":"additional","affiliation":[{"name":"Princeton University"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"320","published-online":{"date-parts":[[2022,7,22]]},"reference":[{"key":"e_1_2_2_1_1","doi-asserted-by":"publisher","DOI":"10.1145\/3306346.3322967"},{"key":"e_1_2_2_2_1","unstructured":"Alexander Panasovsky. 2018. Celtic. https:\/\/thenounproject.com\/icon\/celtic-1975448\/."},{"key":"e_1_2_2_3_1","doi-asserted-by":"publisher","DOI":"10.1145\/3414685.3417833"},{"key":"e_1_2_2_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459775"},{"key":"e_1_2_2_5_1","doi-asserted-by":"publisher","DOI":"10.1109\/34.969114"},{"key":"e_1_2_2_6_1","volume-title":"Training Deep Nets with Sublinear Memory Cost. CoRR abs\/1604.06174","author":"Chen Tianqi","year":"2016","unstructured":"Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. 2016. Training Deep Nets with Sublinear Memory Cost. CoRR abs\/1604.06174 (2016). arXiv:1604.06174 http:\/\/arxiv.org\/abs\/1604.06174"},{"key":"e_1_2_2_7_1","doi-asserted-by":"publisher","DOI":"10.1109\/ICCV.2007.4409003"},{"key":"e_1_2_2_8_1","volume-title":"Memory-Efficient Backpropagation Through Time. CoRR abs\/1606.03401","author":"Gruslys Audrunas","year":"2016","unstructured":"Audrunas Gruslys, R\u00e9mi Munos, Ivo Danihelka, Marc Lanctot, and Alex Graves. 2016. Memory-Efficient Backpropagation Through Time. CoRR abs\/1606.03401 (2016). arXiv:1606.03401 http:\/\/arxiv.org\/abs\/1606.03401"},{"key":"e_1_2_2_9_1","doi-asserted-by":"publisher","DOI":"10.1007\/s003710050084"},{"key":"e_1_2_2_10_1","unstructured":"Inigo Quilez. 2021. Distance Functions. https:\/\/www.iquilezles.org\/www\/articles\/distfunctions\/distfunctions.htm."},{"key":"e_1_2_2_11_1","volume-title":"Funkhouser","author":"Jiang Chiyu Max","year":"2020","unstructured":"Chiyu Max Jiang, Avneesh Sud, Ameesh Makadia, Jingwei Huang, Matthias Nie\u00dfner, and Thomas A. Funkhouser. 2020. Local Implicit Grid Representations for 3D Scenes. CoRR abs\/2003.08981 (2020). arXiv:2003.08981 https:\/\/arxiv.org\/abs\/2003.08981"},{"key":"e_1_2_2_12_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. 2018a. Differentiable Monte Carlo Ray Tracing through Edge Sampling. ACM Trans. Graph. (Proc. SIGGRAPH Asia) 37, 6 (2018), 222:1--222:11.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_2_13_1","doi-asserted-by":"publisher","DOI":"10.1145\/3197517.3201383"},{"key":"e_1_2_2_14_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--193:15.","journal-title":"ACM Trans. Graph. (Proc. SIGGRAPH Asia)"},{"key":"e_1_2_2_15_1","volume-title":"Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning. CoRR abs\/1904.01786","author":"Liu Shichen","year":"2019","unstructured":"Shichen Liu, Tianye Li, Weikai Chen, and Hao Li. 2019. Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning. CoRR abs\/1904.01786 (2019). arXiv:1904.01786 http:\/\/arxiv.org\/abs\/1904.01786"},{"key":"e_1_2_2_16_1","doi-asserted-by":"publisher","DOI":"10.1145\/3355089.3356510"},{"key":"e_1_2_2_17_1","doi-asserted-by":"crossref","unstructured":"Ricardo Martin-Brualla Noha Radwan Mehdi S. M. Sajjadi Jonathan T. Barron Alexey Dosovitskiy and Daniel Duckworth. 2021. NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections. In CVPR.","DOI":"10.1109\/CVPR46437.2021.00713"},{"key":"e_1_2_2_18_1","doi-asserted-by":"crossref","unstructured":"Ben Mildenhall Pratul P. Srinivasan Matthew Tancik Jonathan T. Barron Ravi Ramamoorthi and Ren Ng. 2020. NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. In ECCV.","DOI":"10.1007\/978-3-030-58452-8_24"},{"key":"e_1_2_2_19_1","volume-title":"The zero set of a real analytic function. arXiv preprint arXiv:1512.07276","author":"Mityagin Boris","year":"2015","unstructured":"Boris Mityagin. 2015. The zero set of a real analytic function. arXiv preprint arXiv:1512.07276 (2015)."},{"key":"e_1_2_2_20_1","doi-asserted-by":"publisher","DOI":"10.4213\/mzm12620"},{"key":"e_1_2_2_21_1","doi-asserted-by":"publisher","DOI":"10.1145\/3458817.3476165"},{"key":"e_1_2_2_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/2897824.2925952"},{"key":"e_1_2_2_23_1","volume-title":"Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision. CoRR abs\/1912.07372","author":"Niemeyer Michael","year":"2019","unstructured":"Michael Niemeyer, Lars M. Mescheder, Michael Oechsle, and Andreas Geiger. 2019. Differentiable Volumetric Rendering: Learning Implicit 3D Representations without 3D Supervision. CoRR abs\/1912.07372 (2019). arXiv:1912.07372 http:\/\/arxiv.org\/abs\/1912.07372"},{"key":"e_1_2_2_24_1","doi-asserted-by":"publisher","DOI":"10.1145\/3386569.3392406"},{"key":"e_1_2_2_25_1","doi-asserted-by":"publisher","DOI":"10.1145\/3355089.3356498"},{"key":"e_1_2_2_26_1","volume-title":"DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation. CoRR abs\/1901.05103","author":"Park Jeong Joon","year":"2019","unstructured":"Jeong Joon Park, Peter Florence, Julian Straub, Richard A. Newcombe, and Steven Lovegrove. 2019. DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation. CoRR abs\/1901.05103 (2019). arXiv:1901.05103 http:\/\/arxiv.org\/abs\/1901.05103"},{"key":"e_1_2_2_27_1","doi-asserted-by":"publisher","DOI":"10.1145\/566570.566636"},{"key":"e_1_2_2_28_1","volume-title":"Hypertexture. In Proceedings of the 16th annual conference on Computer graphics and interactive techniques. 253--262","author":"Perlin Ken","year":"1989","unstructured":"Ken Perlin and Eric M Hoffert. 1989. Hypertexture. In Proceedings of the 16th annual conference on Computer graphics and interactive techniques. 253--262."},{"key":"e_1_2_2_29_1","doi-asserted-by":"publisher","DOI":"10.1145\/3310248"},{"key":"e_1_2_2_30_1","volume-title":"Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Representations. CoRR abs\/1906.01618","author":"Sitzmann Vincent","year":"2019","unstructured":"Vincent Sitzmann, Michael Zollh\u00f6fer, and Gordon Wetzstein. 2019. Scene Representation Networks: Continuous 3D-Structure-Aware Neural Scene Representations. CoRR abs\/1906.01618 (2019). arXiv:1906.01618 http:\/\/arxiv.org\/abs\/1906.01618"},{"key":"e_1_2_2_31_1","doi-asserted-by":"publisher","DOI":"10.1109\/9.119632"},{"key":"e_1_2_2_32_1","doi-asserted-by":"publisher","DOI":"10.1145\/3306346.3323035"},{"key":"e_1_2_2_33_1","doi-asserted-by":"publisher","DOI":"10.1145\/3306346.3322996"},{"key":"e_1_2_2_34_1","doi-asserted-by":"publisher","DOI":"10.1111\/cgf.13374"},{"key":"e_1_2_2_35_1","volume-title":"Multiview Neural Surface Reconstruction by Disentangling Geometry and Appearance. Advances in Neural Information Processing Systems 33","author":"Yariv Lior","year":"2020","unstructured":"Lior Yariv, Yoni Kasten, Dror Moran, Meirav Galun, Matan Atzmon, Basri Ronen, and Yaron Lipman. 2020. Multiview Neural Surface Reconstruction by Disentangling Geometry and Appearance. Advances in Neural Information Processing Systems 33 (2020)."},{"key":"e_1_2_2_36_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459807"},{"key":"e_1_2_2_37_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459783"},{"key":"e_1_2_2_38_1","doi-asserted-by":"publisher","DOI":"10.1145\/3450626.3459782"},{"key":"e_1_2_2_39_1","doi-asserted-by":"publisher","DOI":"10.1145\/3452097"}],"container-title":["ACM Transactions on Graphics"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3528223.3530125","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3528223.3530125","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,6,17]],"date-time":"2025-06-17T19:02:26Z","timestamp":1750186946000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3528223.3530125"}},"subtitle":["autodiff for discontinuous programs - applied to shaders"],"short-title":[],"issued":{"date-parts":[[2022,7]]},"references-count":39,"journal-issue":{"issue":"4","published-print":{"date-parts":[[2022,7]]}},"alternative-id":["10.1145\/3528223.3530125"],"URL":"https:\/\/doi.org\/10.1145\/3528223.3530125","relation":{},"ISSN":["0730-0301","1557-7368"],"issn-type":[{"value":"0730-0301","type":"print"},{"value":"1557-7368","type":"electronic"}],"subject":[],"published":{"date-parts":[[2022,7]]},"assertion":[{"value":"2022-07-22","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}