# Draw shiny lines

**URL:** <https://discourse.processing.org/t/draw-shiny-lines/2630>\
**Category:** Processing\
**Created:** [August 14, 2018, 9:25am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630 "2018-08-14T09:25:04Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [August 14, 2018, 9:25am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/1 "2018-08-14T09:25:04Z")

</div>

I friends,

How can I do shiny lines like that in P2D mode (it’s an image from the last Aphex Twin clip) ?  
 ![afx](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/c/cf1f5d2553263419da062de0f40bb25c47cc54f7.png)

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [August 14, 2018, 9:48am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/2 "2018-08-14T09:48:41Z")

</div>

For the yellow line, I would draw an orange gradient from transparent to opaque to transparent.  
Then I would blur it a lot.  
And finally I would add the yellow line on top of it.  
Maybe also blurring that line a bit so it would fuse better with the orange part 🤔

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [August 14, 2018, 10:46am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/3 "2018-08-14T10:46:46Z")

</div>

Ok thanks but blur() really slow down the framerate because it fit on the all screen.  
There is a way to put it only on some element.

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [August 14, 2018, 10:50am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/4 "2018-08-14T10:50:02Z")

</div>

You can store your line in a PGraphic the size of your line maybe?

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [August 14, 2018, 11:14am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/5 "2018-08-14T11:14:38Z")

</div>

Perhaps a one-pixel high image the width of your line and blur, white in the middle blurring to alpha on the edges? Draw the strokes using `tint()`and `image()`, translating and rotating where you need to.

Are you using a GLSL shader blur operation?

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [August 14, 2018, 11:21am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/6 "2018-08-14T11:21:06Z")

</div>

Even with a pgGraphics only for my lines the programs slow down.  
I’m using processing filter(BLUR, 4) function. With GLSL it’s faster ?

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [August 14, 2018, 11:34am UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/7 "2018-08-14T11:34:20Z")

</div>

Ok I have better result with GLSL shaders, no lagging time. I just have to found the right one.  
Thanks !

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [August 14, 2018, 12:01pm UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/8 "2018-08-14T12:01:43Z")

</div>

You shouldn’t use the standard filter options with P2D or P3D, but the filter method that takes a PShader.

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [August 14, 2018, 12:03pm UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/9 "2018-08-14T12:03:54Z")

</div>

> [@matheplica](#):
>
> I just have to found the right one.

Actually looking at your image again, you might want to look at a bloom filter - eg. [GitHub - cansik/processing-bloom-filter: An example of a bloom filter as post fx in processing3.](https://github.com/cansik/processing-bloom-filter)

---

<div class="post-metadata">

**Author:** ![matheplica](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/matheplica/32/21035_2.png) [@matheplica](https://discourse.processing.org/u/matheplica)\
**Post date:** [August 14, 2018, 12:06pm UTC](https://discourse.processing.org/t/draw-shiny-lines/2630/10 "2018-08-14T12:06:18Z")

</div>

Funny, I wanted to write you that I found this one. I will try with the library
