# Set uniform double in shader

**URL:** <https://discourse.processing.org/t/set-uniform-double-in-shader/23106>\
**Category:** Processing\
**Created:** [August 7, 2020, 11:53am UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106 "2020-08-07T11:53:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![toby](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/toby/32/5434_2.png) [@toby](https://discourse.processing.org/u/toby)\
**Post date:** [August 7, 2020, 11:53am UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106/1 "2020-08-07T11:53:16Z")

</div>

Hello all

I’m using a fragment shader to compute fractals, so I’d like to use doubles in the shader. However the PShader.set() method for setting shader uniforms only supports float. Can anyone suggest how I can set a double? My fractals are getting blocky too quickly! 🙂

Thanks,  
Toby

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 7, 2020, 5:19pm UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106/2 "2020-08-07T17:19:43Z")

</div>

> **[processing/processing](https://github.com/processing/processing/issues)**
>
> Source code for the Processing Core and Development Environment (PDE) - processing/processing

---

<div class="post-metadata">

**Author:** ![toby](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/toby/32/5434_2.png) [@toby](https://discourse.processing.org/u/toby)\
**Post date:** [August 8, 2020, 3:30pm UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106/3 "2020-08-08T15:30:20Z")

</div>

Hi, thank you for your reply. I’m not sure how to proceed. Are you suggesting I open an issue on GutHub?

If that’s the case, I will. I would welcome any ideas for a workaround too.

Thanks,  
Toby

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [August 8, 2020, 3:39pm UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106/4 "2020-08-08T15:39:38Z")

</div>

> [@toby](#):
>
> Are you suggesting I open an issue on GitHub?

Yes! if you look up inside the PShader class you won’t find any mention of `double` there:

> <https://github.com/processing/processing/blob/master/core/src/processing/opengl/PShader.java>

But I believe it’s feasible for the devs to add `double` functionality for PShader.

---

<div class="post-metadata">

**Author:** ![toby](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/toby/32/5434_2.png) [@toby](https://discourse.processing.org/u/toby)\
**Post date:** [August 8, 2020, 6:22pm UTC](https://discourse.processing.org/t/set-uniform-double-in-shader/23106/5 "2020-08-08T18:22:41Z")

</div>

Thanks for clarifying. I’ll open an issue. Having looked at the code, adding double seems straightforward technically.

cheers!  
Toby
