# Best approach to applying GLSL shaders to Components?

**URL:** <https://forum.juce.com/t/best-approach-to-applying-glsl-shaders-to-components/23905>\
**Category:** General JUCE discussion\
**Created:** [August 25, 2017, 4:10pm UTC](https://forum.juce.com/t/best-approach-to-applying-glsl-shaders-to-components/23905 "2017-08-25T16:10:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [August 25, 2017, 4:10pm UTC](https://forum.juce.com/t/best-approach-to-applying-glsl-shaders-to-components/23905/1 "2017-08-25T16:10:50Z")

</div>

JUCE’s OpenGL implementation is considerably more challenging to use (and optimise!) when compared to QT or the likes, so I’m wondering if anybody has had any experience applying shaders to Components - and what have the results been like?

I’m looking to implement and contextually use GPU-based drop shadows and blurs instead of bottlenecking the CPU unnecessarily - but this is proving to be non-evident.

ie: Showing a drop shadow underneath a `CallOutBox`, but using a shader (not CPU-bound pixel mashing like `DropShadowEffect`/`DropShadow`/`DropShadower` do).

---

<div class="post-metadata">

**Author:** ![gludhani](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@gludhani](https://forum.juce.com/u/gludhani)\
**Post date:** [August 25, 2017, 4:25pm UTC](https://forum.juce.com/t/best-approach-to-applying-glsl-shaders-to-components/23905/2 "2017-08-25T16:25:34Z")

</div>

I used DropShadowEffect to display shadow for a component and it resulted in poor performance when the component was displayed. The whole application became sluggish. After doing some time profiling using Instruments, I found that blurDataTriplets in DropShadowEffect is consuming a lot of time.  
To overcome the performance issue, I painted shadow from the paint method of the component, though the appearance of shadow was not as crisp as using DropShadowEffect.

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [October 27, 2017, 3:29pm UTC](https://forum.juce.com/t/best-approach-to-applying-glsl-shaders-to-components/23905/3 "2017-10-27T15:29:00Z")

</div>

I’m saddened by the lack of input on this one.

I guess this means it’s not possible to change up anything from a Component via the GL pipeline? We’re stuck hand-rolling our own Component drawing strategy?
