Abstract
Recent trends in computer-graphics APIs and hardware have made it practical to use high-level functional languages for real-time graphics applications. Thus we have the opportunity to develop new approaches to computer graphics that take advantage of the high-level features of functional languages. This paper describes one such project that uses the techniques of functional programming to define and implement a combinator library for particle systems. Particle systems are a popular technique for rendering fuzzy phenomena, such as fire, smoke, and explosions. Using our combinators, a programmer can provide a declarative specification of how a particle system behaves. This specification includes rules for how particles are created, how they evolve, and how they are rendered. Our library translates these declarative specifications into a low-level intermediate language that can be compiled to run on the GPU or interpreted by the CPU.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Apple Inc.: Quartz Composer Programming Guide (October 2008), http://developer.apple.com
Elliott, C.: Programming graphics processors functionally. In: Haskell 2004. ACM Press, New York (2004)
Elliott, C., Hudak, P.: Functional reactive animation. In: ICFP 1997, pp. 263–273. ACM Press, New York (1997)
Harris, M.: Parallel prefix sum (scan) with CUDA. In: GPU Gems 3. Addison-Wesley, Reading (2007)
Khronos OpenCL Working Group: The OpenCL Specification (Version 1.1) (2010), http://www.khronos.org/opencl
Kipfer, P., Segal, M., Westermann, R.: Uberflow: a gpu-based particle engine. In: HWWS 2004, pp. 115–122. ACM, New York (2004)
Leijen, D., Meijer, E.: Domain specific embedded compilers. In: DSL 1999, pp. 109–122. ACM, New York (1999)
McAllister, D.K.: The design of an API for particle systems. Tech. rep., University of North Carolina (January 2000), www.particlesystems.org
Reeves, W.T.: Particle systems—a technique for modeling a class of fuzzy objects. ACM Trans. Graph. 2(2), 91–108 (1983)
Rost, R.J., Licea-Kane, B.: OpenGL Shading Language, 3rd edn. Addison-Wesley, Reading (2010)
Shivers, O.: Useless-variable elimination. In: WSA 1991 (October 1991)
The SML3d library, http://sml3d.cs.uchicago.edu
Witkin, A.: An introduction to physically based modeling: Particle system dynamics (1997), http://www.cs.cmu.edu/~baraff/pbm/constraints.pdf
Yi, M., Froemke, Q.: Ticker tape: A scalable 3d particle system with wind and air resistance (May 2010), http://software.intel.com/en-us/articles/tickertape
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Krajcevski, P., Reppy, J. (2011). A Declarative API for Particle Systems. In: Rocha, R., Launchbury, J. (eds) Practical Aspects of Declarative Languages. PADL 2011. Lecture Notes in Computer Science, vol 6539. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-18378-2_12
Download citation
DOI: https://doi.org/10.1007/978-3-642-18378-2_12
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-18377-5
Online ISBN: 978-3-642-18378-2
eBook Packages: Computer ScienceComputer Science (R0)