# Fragment shader too many uniforms error

**URL:** <https://discourse.processing.org/t/fragment-shader-too-many-uniforms-error/17603>\
**Category:** Coding Questions\
**Created:** [February 7, 2020, 3:14am UTC](https://discourse.processing.org/t/fragment-shader-too-many-uniforms-error/17603 "2020-02-07T03:14:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hamoid](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/hamoid/32/58_2.png) [@hamoid](https://discourse.processing.org/u/hamoid)\
**Post date:** [February 13, 2020, 4:16pm UTC](https://discourse.processing.org/t/fragment-shader-too-many-uniforms-error/17603/4 "2020-02-13T16:16:14Z")

</div>

[https://editor.p5js.org/abe/sketches/H8K7bY5s](https://editor.p5js.org/abe/sketches/H8K7bY5s)

![canvas](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1707476186abd70acbdee5baa8a98093b0ba963f.png)

Here something done very quickly and without much thinking 🙂 I hope the code is not too bad. I’m curious about performance on mobile, as for-loops are not recommended in shaders. For each pixel in the screen it checks the distance to all particles to calculate brightness. The brute force approach.

---

_[View the full topic](https://discourse.processing.org/t/fragment-shader-too-many-uniforms-error/17603)._
