We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi all,
I am new to GLSL, I recently took a workshop that used GLSL and openFrameworks (first time) and would like to use what I learned with Processing. In this example I would like to just make the window a solid color.
PShader test;
void setup() {
size(640, 360, P2D);
noStroke();
fill(204);
test = loadShader("testFrag.glsl", "testVert.glsl");
}
void draw() {
shader(test);
rect(0, 0, width, height);
}
//testFrag.glsl
#define PROCESSING_COLOR_SHADER
void main()
{
// Setting Each Pixel To Red
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
//testVert.glsl
void main()
{
// Transforming The Vertex
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
Thanks.
Answers
Removing "testVert.glsl" from the loadShader line solved my problem
Feel free to post any tips you have here: http://forum.processing.org/two/discussion/4408/glsl-tips-for-noobs#Item_4