Hey there,
I just worked me into shaders and I am having some problems right with the first example I try.
I am getting a grey quad instead of a colored quad with the example which can be found here: http://openframeworks.cc/tutorials/graphics/shaders.html
Here is my source. What am i doing wrong?
shader gets loaded and shows “no errors” in the terminal…
any ideas?
main.cpp:
int main( ){
ofSetLogLevel(OF_LOG_VERBOSE);
ofSetupOpenGL(1024,768, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp( new ofApp());
}
ofApp.cpp:
void ofApp::setup(){
shader.load("shaders/noise.vert", "shaders/noise.frag");
}
void ofApp::draw(){
ofSetColor(255);
shader.begin();
ofRect(0, 0, ofGetWidth(), ofGetHeight());
shader.end();
}