references indicate that neither handles lighting
uniforms automatically. Processing re-implemented
in its default shaders the standard lighting from the
fixed pipeline in OpenGL 1.1 (Woo et al., 1997),
where up to 8 lights could be defined
simultaneously.
5 CONCLUSIONS
We described a shader API currently implemented in
the Processing programming language. This API is
publicly available, as it was first introduced in the
version 2.0 of Processing in 2013, and refined and
completed in version 3.0, released in late 2015.
From the responses observed in several online
forums, we infer that the API is being used by a
fraction of the Processing users, but we do not know
how large this group of users is, or how expert they
are in OpenGL and GLSL shaders. We aim at
quantifying these parameters in the near future, in
order to better characterize the adoption of shader
programming within the creative coding community.
We also compared the shader APIs in
Processing, OF, and Cinder, and observed that they
follow a similar structure where shader information
is encapsulated in classes, and several uniform and
attribute variables are automatically passed down to
the pipeline. Processing sends a few additional
uniforms, normal and texture matrices, as well as
detailed lighting information. This, together with the
automatic tessellation of custom vertex attributes,
suggests a closer integration in Processing of the
standard drawing API with the new shader
functionality. However, this closer integration might
come at the expense of API flexibility that is
possible, and in fact sought after, in more advanced
frameworks such as OF and Cinder. Future work
will include in-depth study of API complexity and
precise quantification of API flexibility using
standard methodologies.
Our overarching goal is to propose new answers
to the question of how to effectively incorporate
shader programming into computational arts and
design. This question could be answered in two
stages. First, by creating mechanisms that
incorporate shaders into the rendering paths of high-
level frameworks, and second, by moving shader
code writing and testing closer to the framework so
that not only CPU/GPU code can be written side-by-
side, but also high-level calls can be directly mapped
onto the shader functions and variables. In this
article, we addressed the first stage, and we plan to
study the second stage in upcoming work.
ACKNOWLEDGEMENTS
The authors would like to thank Casey Reas and Ben
Fry for their tireless work with Processing over the
years, and also to acknowledge the huge
contributions from all the members of the
Processing, OF, and Cinder communities. AC would
like to thank very specially Casey Reas, Ben Fry,
and Daniel Shiffman for the numerous discussions in
person and over email that led to the final form of
the shader API in Processing.
REFERENCES
Angel, E. & Shreiner, D. 2012. Introduction to modern
OpenGL programming. SIGGRAPH '12.
Ascioglu, S. OpenProcessing classrooms [Online].
Available: http://openprocessing.org/classrooms
Bell, A. OpenGL in Cinder [Online]. Available:
https://libcinder.org/docs/guides/opengl/
Bell, A. 2015. OpenGL in Cinder 0.9.0 [Online].
Available: https://forum.libcinder.org/topic/opengl-in-
cinder-0-9-0.
Bell, A., Nguyen, H., Eakin, R. & Houx, P. Cinder home
page [Online]. Available: https://libcinder.org/
Brewis, D. 2014. Emerging Environments for Interactive
Art Creation. Interactive Multimedia Conference.
University of Southampton.
Castro, A. 2014. Of Shader given GLSL variables
[Online]. Available: http://forum.openframeworks.cc/
t/ofshader-given-glsl-variables/16567/2
Colubri, A I. PShader tutorial [Online]. Available:
https://www.processing.org/tutorials/pshader/
Colubri, A II. PShader tutorials code samples [Online].
Available: https://github.com/codeanticode/pshader-
tutorials.
Colubri, A III. PShader experiments [Online]. Available:
https://github.com/codeanticode/pshader-experiments/
Colubri, A. 2008. HD (in) Processing. International
Conference on Advances of Computer Entertainment
Technology. Yokohama, Japan.
Colubri, A. & Fry, B. 2012. Introducing Processing 2.0.
ACM SIGGRAPH 2012 Talks. Los Angeles,
California: ACM.
Glazier, B. 1992. The "best principle": why OpenGL is
emerging as the 3D graphics standard. Computer
Graphics World, 15, 116.
Gomez, A. F., Charalambos, J. P. & Colubri, A. 2015.
ShaderBase: a Processing Tool for Shaders in
Computational Arts and Design.
Kanat-Alexander, M., Oram, A. & Hendrickson, M. 2012.
Code Simplicity: The Fundamentals of Software.
Karluk, L., Noble, J. & Puig, J. 2013. Introducing Shaders
[Online]. Available: http://openframeworks.cc/
tutorials/graphics/shaders.html
Mccarthy, L. p5.js project [Online]. Available:
http://p5js.org/