Created
January 12, 2016 06:56
-
-
Save elliotwoods/c36724b7f8b90a7abd1a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 150 | |
uniform sampler2DRect tex0; | |
in vec2 texCoordVarying; | |
out vec4 outputColor; | |
uniform float minimum; | |
uniform float maximum; | |
void main() { | |
vec4 inputColor = texture2DRect(tex0, texCoordVarying); | |
outputColor = (inputColor - minimum) / (maximum - minimum); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 150 | |
// these are for the programmable pipeline system and are passed in | |
// by default from OpenFrameworks | |
uniform mat4 modelViewProjectionMatrix; | |
in vec4 position; | |
in vec2 texcoord; | |
// this is something we're creating for this shader | |
out vec2 texCoordVarying; | |
void main() | |
{ | |
// here we move the texture coordinates | |
texCoordVarying = texcoord; | |
// send the vertices to the fragment shader | |
gl_Position = modelViewProjectionMatrix * position; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shader.begin(); | |
shader.setUniform1f("minimum", this->style.rangeMinimum); | |
shader.setUniform1f("maximum", this->style.rangeMaximum); | |
this->texture.draw(0, 0, width, height); | |
shader.end(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
access violation if ofShader.cpp: