# How to include utilities from a GLSL file

**URL:** <https://discourse.libcinder.org/t/how-to-include-utilities-from-a-glsl-file/147>\
**Category:** Using Cinder\
**Created:** [July 11, 2016, 1:28pm UTC](https://discourse.libcinder.org/t/how-to-include-utilities-from-a-glsl-file/147 "2016-07-11T13:28:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![raedatoui](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/raedatoui/32/97_2.png) [@raedatoui](https://discourse.libcinder.org/u/raedatoui)\
**Post date:** [July 11, 2016, 1:28pm UTC](https://discourse.libcinder.org/t/how-to-include-utilities-from-a-glsl-file/147/1 "2016-07-11T13:28:06Z")

</div>

Hello,

what is the recommended method for requiring a file of GLSL functions in a vert or frag shader ?  
I am using an vertex attributes shader similarly to the example \_opengl/ParticleShpereGPU  
The file that i wish to include has many utility functions for blending colors, ie, the PhotoshopMathFP one from here [https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/](https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/)

---

<div class="post-metadata">

**Author:** ![gabor\_papp](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/gabor_papp/32/769_2.png) [@gabor\_papp](https://discourse.libcinder.org/u/gabor_papp)\
**Post date:** [July 11, 2016, 1:45pm UTC](https://discourse.libcinder.org/t/how-to-include-utilities-from-a-glsl-file/147/2 "2016-07-11T13:45:23Z")

</div>

`GlslProg` supports the `#include` statement. Check out the DeferredShadingAdvanced sample:  
[https://github.com/cinder/Cinder/blob/master/samples/\_opengl/DeferredShadingAdvanced/assets/deferred/debug.frag](https://github.com/cinder/Cinder/blob/master/samples/_opengl/DeferredShadingAdvanced/assets/deferred/debug.frag)

---

<div class="post-metadata">

**Author:** ![raedatoui](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.libcinder.org/raedatoui/32/97_2.png) [@raedatoui](https://discourse.libcinder.org/u/raedatoui)\
**Post date:** [July 11, 2016, 7:40pm UTC](https://discourse.libcinder.org/t/how-to-include-utilities-from-a-glsl-file/147/3 "2016-07-11T19:40:32Z")

</div>

awesome thank you! that worked
