We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Sometimes i find functions and workarounds still valid dated back in Processing Forum v1.0
- Here you can post everything you find interesting about Shaders, GLSL and Processing
Lost &Found Github Repository, general Links, Tutorials
//imagine a question mark behind every line
PShader shdr;
void setup() {
size(640, 360, P2D);
noStroke();
rectMode(RADIUS);
shdr=new PShader(this,
new String[]{"#version 150 \n"
+ "in vec2 position;"
+ "void main() {"
+ "gl_Position = vec4(position.xy,0.,1.);"
+ "}"
}, new String[]{"#version 150 \n"
+ "out vec4 fragColor;"
+ "uniform vec3 iResolution;"
+ "void main() {"
+ "vec2 uvv = (gl_FragCoord.xy*2.-iResolution.xy)/iResolution.z;"
+ "float cir=.2/length(uvv);"
+ "fragColor = vec4(vec3(cir),1.);"
+"}"
});
shdr.set("iResolution", new PVector(width, height, Math.min(width, height)));
shader(shdr);
}
void draw() {
background(0);
rect(0, 0, width, height);
}
Comments
https://forum.processing.org/two/discussion/22385/reaction-diffusion-using-glsl-works-different-from-normal#latest
observation
missing pixel
what is wrong with gl_FragCoord ?
this shader works around the world, - its a processing intern issue
Update: okay, okay i was my failure i start mixing processing and jogl functions = map(mouseX, 0, width, 0, 1) :)
the shader gives the corect results
https://thebookofshaders.com/07/rect-01.jpg
so anyone who came along this post in the further, you have to convert from float into bytes or visa versa.
link to source files
some other: https://github.com/mc-imperial/shader-compiler-bugs
OKAY THIS WENT SOLVED
https://forum.processing.org/two/discussion/22385/reaction-diffusion-using-glsl-works-different-from-normal#latest
So simply put - don't rely on shaders for delicate computations and use them only for what they're meant - graphic effects.
PURE ART
The OpenGL 4.4 Specification Cover Page
unfortunately nothing for mac users
https://www.khronos.org/registry/OpenGL/specs/gl/glspec44.core.pdf