A declarative API for particle systems. (English)
Rocha, Ricardo (ed.) et al., Practical aspects of declarative languages. 13th international symposium, PADL 2011, Austin, TX, USA, January 24‒25, 2011. Proceedings. Berlin: Springer (ISBN 978-3-642-18377-5/pbk). Lecture Notes in Computer Science 6539, 130-144 (2011).
Summary: 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.