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
precision highp float; | |
void main() | |
{ | |
// gl_FragCoord contains the window relative coordinate for the fragment. | |
// we use gl_FragCoord.x position to control the red color value. | |
// we use gl_FragCoord.y position to control the green color value. | |
// please note that all r, g, b, a values are between 0 and 1. | |
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
attribute vec4 position; | |
uniform mat4 modelViewProjectionMatrix; | |
void main(){ | |
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
#include "ofMain.h" | |
#include "ofApp.h" | |
// comment out the line below if you want to use a fixed pipeline opengl renderer, | |
// otherwise leave this line uncommented if you want to use a programmable pipeline opengl renderer. | |
#define USE_PROGRAMMABLE_RENDERER | |
#ifdef USE_PROGRAMMABLE_RENDERER | |
#include "ofGLProgrammableRenderer.h" | |
#endif |
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
#ifndef _TEST_APP | |
#define _TEST_APP | |
#include "ofMain.h" | |
#include "ofxAndroid.h" | |
class ofApp : public ofxAndroidApp{ | |
public: |
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
#include "ofApp.h" | |
//-------------------------------------------------------------- | |
void ofApp::setup(){ | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
ofBackground(34, 34, 34); | |
ofSetVerticalSync(false); | |
ofEnableAlphaBlending(); |
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 120 | |
void main() { | |
vec4 color; | |
float xCor = gl_FragCoord.x; | |
vec4 white = vec4(1); | |
vec4 black = vec4(0); | |
float x = smoothstep(0, 960.0, xCor); |
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
void testApp::draw() | |
{ | |
if(doShader) | |
shader.begin(); | |
gradient.draw(0,0,960,540); | |
if(doShader) | |
shader.end(); |
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 120 | |
void main(){ | |
//this is the fragment shader | |
//this is where the pixel level drawing happens | |
//gl_FragCoord gives us the x and y of the current pixel its drawing | |
gl_FragColor.r = gl_Color.r + 20; | |
gl_FragColor.g = gl_Color.g + 20; |
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
#include "testApp.h" | |
//-------------------------------------------------------------- | |
void testApp::setup(){ | |
ofSetLogLevel(OF_LOG_VERBOSE); | |
ofBackground(34, 34, 34); | |
ofSetVerticalSync(false); | |
ofEnableAlphaBlending(); | |
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
#pragma once | |
#include "ofMain.h" | |
class testApp : public ofBaseApp{ | |
public: | |
void setup(); | |
void update(); | |
void draw(); |