toby
August 7, 2020, 11:53am
1
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
toby
August 8, 2020, 3:30pm
3
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
Yes! if you look up inside the PShader class you won’t find any mention of double
there:
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2012-15 The Processing Foundation
Copyright (c) 2004-12 Ben Fry and Casey Reas
Copyright (c) 2001-04 Massachusetts Institute of Technology
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation, version 2.1.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
This file has been truncated. show original
But I believe it’s feasible for the devs to add double
functionality for PShader .
toby
August 8, 2020, 6:22pm
5
Thanks for clarifying. I’ll open an issue. Having looked at the code, adding double seems straightforward technically.
cheers!
Toby