Is there any way to ignore the locale of the machine when formatting numbers?
For example, always force the decimal separator to a "." rather than the "," in some parts of the world?
.... without changing the system preferences of course.
Are you referring to the Format Number node? That node uses the system's locale. You can override it on a per-app basis (System Preferences > Language & Region, and click the Apps tab), but Vuo doesn't currently provide a way to change it beyond that.
Can you share why you want different formatting than the system provides? With more context about what you're trying to do, we might be able to provide more help.
Paul responded that he is trying to work with shader input. Since Shadertoy's inputs are limited, the other option would be to try Vuo's shader editor (File > New Shader), which allows specifying additional input ports.
OK, clearly missing something basic here.
Specifically, conventions for input labelling, see attached.
"panangle" seems to work, but not width, height and Image.
This is using the shader editor, any documentation of examples?
Vuo's shader editor uses ISF syntax, which differs a bit from standard GLSL. To get the width and height, use RENDERSIZE.x and RENDERSIZE.y. To sample from the input image, use IMG_NORM_PIXEL(Image, coordinate) (to sample in normalized coordinates) or IMG_PIXEL(Image, coordinate) (to sample in integer pixel coordinates).
Also, your shader begins with void mainImage(out vec4 fragColor, vec2 fragCoord) { … } — that's Shadertoy's dialect of GLSL, which isn't compatible with ISF GLSL. You'll need to use void main() { … }, get the current fragment coordinate using isf_FragNormCoord.xy (normalized coordinates) or gl_FragCoord.xy (integer pixel coordinates), and set the current fragment color using gl_FragColor = vec4(…);.
Comments
The way around is to do a
The way around is to do a search and replace of "," with ".".
Are you referring to the
Are you referring to the
Format Number
node? That node uses the system's locale. You can override it on a per-app basis (System Preferences > Language & Region, and click the Apps tab), but Vuo doesn't currently provide a way to change it beyond that.Can you share why you want different formatting than the system provides? With more context about what you're trying to do, we might be able to provide more help.
Paul responded that he is
Paul responded that he is trying to work with shader input. Since Shadertoy's inputs are limited, the other option would be to try Vuo's shader editor (File > New Shader), which allows specifying additional input ports.
OK, clearly missing something
OK, clearly missing something basic here. Specifically, conventions for input labelling, see attached. "panangle" seems to work, but not width, height and Image. This is using the shader editor, any documentation of examples?
Screen Shot 2021-06-11 at 12.34.06 pm.png
Vuo's shader editor uses ISF
Vuo's shader editor uses ISF syntax, which differs a bit from standard GLSL. To get the width and height, use
RENDERSIZE.x
andRENDERSIZE.y.
To sample from the input image, useIMG_NORM_PIXEL(Image, coordinate)
(to sample in normalized coordinates) orIMG_PIXEL(Image, coordinate)
(to sample in integer pixel coordinates).Also, your shader begins with
void mainImage(out vec4 fragColor, vec2 fragCoord) { … }
— that's Shadertoy's dialect of GLSL, which isn't compatible with ISF GLSL. You'll need to usevoid main() { … }
, get the current fragment coordinate usingisf_FragNormCoord.xy (normalized coordinates)
orgl_FragCoord.xy (integer pixel coordinates)
, and set the current fragment color usinggl_FragColor = vec4(…);
.You can select View > Show GLSL/ISF Quick Reference to see an overview of the variables and functions available, including the ISF extensions. There's also documentation at https://doc.vuo.org/2.3.0/manual/turning-graphics-shaders-into-nodes.xhtml .