title: Shaders not working as expected
body: <p>Using OpenGL 3.2 / GLSL 150 with OpenFrameworks v0.8.3</p>
  
  <p>I'm trying to implement shaders into my programs. My program successfully loads the correct frag and vert files, but I get this glitched visual and error: </p>
  
  <p><a href="https://i.stack.imgur.com/SKpjg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SKpjg.jpg" alt="enter image description here"></a></p>
  
  <pre><code>[ error ] ofShader: setupShaderFromSource(): GL_FRAGMENT_SHADER shader failed to compile
  [ error ] ofShader: GL_FRAGMENT_SHADER shader reports:
  ERROR: 0:39: Use of undeclared identifier 'gl_FragColor'
  </code></pre>
  
  <p>I read this <a href="https://stackoverflow.com/a/26695347/1757149">SO answer</a> explaining that <code>gl_FragColor</code> is not supported in GLSL 300, but I'm (pretty sure I'm) not using that version. Regardless, when I change <code>gl_FragColor</code> with an <code>outputColor</code> var, my screen just appears black with no error.</p>
  
  <p>Why isn't my shader appearing as expected? I have a feeling it is either my .vert file / a fundamental misunderstanding of how shapes are drawn from within shaders, or versioning problems.</p>
  
  <p>My simplified program:</p>
  
  <p><strong>.h</strong></p>
  
  <pre><code>#pragma once
  
  #include "ofMain.h" //includes all openGL libs/reqs
  #include "GL/glew.h"
  #include "ofxGLSLSandbox.h" //addon lib for runtime shader editing capability
  
  class ofApp : public ofBaseApp{
  
  public:
      void setup();
      void draw();
  
      ofxGLSLSandbox *glslSandbox; //an object from the addon lib
  };
  </code></pre>
  
  <p><strong>.cpp</strong></p>
  
  <pre><code>#include "ofApp.h"
  //--------------------------------------------------------------
  void ofApp::setup(){
      // create new ofxGLSLSandbox instance
      glslSandbox = new ofxGLSLSandbox();
  
      // setup shader width and height
      glslSandbox-&gt;setResolution(800, 480);
  
      // load fragment shader file
      glslSandbox-&gt;loadFile("shader"); //shorthand for loading both .frag and .vert as they are both named "shader.frag" and "shader.vert" and placed in the correct dir
  }
  //--------------------------------------------------------------
  void ofApp::draw(){
      glslSandbox-&gt;draw();
  }
  </code></pre>
  
  <p><strong>.vert</strong> (just meant to be a pass-through... if that makes sense)</p>
  
  <pre><code>#version 150
  
  uniform mat4 modelViewProjectionMatrix;
  in vec4 position;
  
  void main(){
      gl_Position = modelViewProjectionMatrix * position;
  }
  </code></pre>
  
  <p><strong>.frag</strong> (see 3rd interactive code block down <a href="http://patriciogonzalezvivo.com/2015/thebookofshaders/07/" rel="nofollow noreferrer">this page</a> for intended result)</p>
  
  <pre><code>#version 150
  
  #ifdef GL_ES
      precision mediump float;
  #endif
  
  out vec4 outputColor;
  
  uniform vec2 u_resolution;
  uniform vec2 u_mouse;
  uniform float u_time;
  
  float circle(in vec2 _st, in float _radius){
      vec2 dist = _st-vec2(0.5);
      return 1.-smoothstep(_radius-(_radius*0.01),
                           _radius+(_radius*0.01),
                           dot(dist,dist)*4.0);
  }
  
  void main(){
      vec2 st = gl_FragCoord.xy/u_resolution.xy;
      vec3 color = vec3(circle(st,0.9));
      outputColor = vec4( color, 1.0 );
  }
  </code></pre>