Desktop Fail
Mac’s “⌘–Space” Spotlight
iTunes Icons
Photoshop Icons
Brand Colours
West Coast vs. East Coast
Schroen’s Visual Recognition Order
Organizing space
precision highp float;
uniform vec3 iResolution;
uniform float iGlobalTime;
uniform vec4 iMouse;
uniform float iRadius;
uniform float iBeam;
uniform float iBeamWidth;
void main() {
vec2 p = (gl_FragCoord.xy - iMouse.xy) / iResolution.y;
float a = atan(p.x, p.y);
float r = length(p) - iRadius;
vec2 uv = vec2(a, r);
vec3 horColour = vec3(gl_FragCoord.xy / iResolution.xy, 0.5);
vec3 horBeam = vec3(abs(iBeam / (iBeamWidth * uv.y)));
gl_FragColor = vec4(horBeam * horColour, 1.0);
}
Shadertoy fragment shader
private void initShaderVariables() {
vPosition = GLES20.glGetAttribLocation(program, "vPosition");
iResolution = GLES20.glGetUniformLocation(program, "iResolution");
iGlobalTime = GLES20.glGetUniformLocation(program, "iGlobalTime");
iMouse = GLES20.glGetUniformLocation(program, "iMouse");
iRadius = GLES20.glGetUniformLocation(program, "iRadius");
iBeam = GLES20.glGetUniformLocation(program, "iBeam");
iBeamWidth = GLES20.glGetUniformLocation(program, "iBeamWidth");
}
Android OpenGL ES 2.0 Shadertoy variables
private void setShaderVariables() {
GLES20.glUniform3f(iResolution, screenWidth, screenHeight,
(float)screenWidth / (float)screenHeight);
Date date = new Date();
float time = (float) (date.getTime() - startTime) / 1000.0f;
GLES20.glUniform1f(iGlobalTime, time);
GLES20.glUniform4f(iMouse, touchX, touchY,
touchActive ? touchX : 0, touchActive ? touchY : 0);
GLES20.glUniform1f(iRadius, radiusPos);
GLES20.glUniform1f(iBeam, beamPos);
GLES20.glUniform1f(iBeamWidth, beamWidthPos);
}
Android OpenGL ES 2.0 set Shadertoy variables
Create a gesture?
ID | Gesture |
---|---|
1 | GESTURE_SWIPE_UP |
2 | GESTURE_SWIPE_DOWN |
3 | GESTURE_SWIPE_LEFT |
4 | GESTURE_SWIPE_RIGHT |
5 | GESTURE_SWIPE_LEFT_AND_RIGHT |
6 | GESTURE_SWIPE_RIGHT_AND_LEFT |
7 | GESTURE_SWIPE_UP_AND_DOWN |
8 | GESTURE_SWIPE_DOWN_AND_UP |
9 | GESTURE_CLOCKWISE_CIRCLE |
10 | GESTURE_COUNTER_CLOCKWISE_CIRCLE |
11 | GESTURE_SWIPE_LEFT_AND_UP |
12 | GESTURE_SWIPE_LEFT_AND_DOWN |
13 | GESTURE_SWIPE_RIGHT_AND_UP |
14 | GESTURE_SWIPE_RIGHT_AND_DOWN |
15 | GESTURE_SWIPE_UP_AND_LEFT |
16 | GESTURE_SWIPE_UP_AND_RIGHT |
17 | GESTURE_SWIPE_DOWN_AND_LEFT |
18 | GESTURE_SWIPE_DOWN_AND_RIGHT |
ID | Gesture |
---|---|
1 | GESTURE_SWIPE_UP |
2 | GESTURE_SWIPE_DOWN |
3 | GESTURE_SWIPE_LEFT |
4 | GESTURE_SWIPE_RIGHT |
5 | GESTURE_SWIPE_LEFT_AND_RIGHT |
6 | GESTURE_SWIPE_RIGHT_AND_LEFT |
7 | GESTURE_SWIPE_UP_AND_DOWN |
8 | GESTURE_SWIPE_DOWN_AND_UP |
9 | GESTURE_CLOCKWISE_CIRCLE |
10 | GESTURE_COUNTER_CLOCKWISE_CIRCLE |
11 | GESTURE_SWIPE_LEFT_AND_UP |
12 | GESTURE_SWIPE_LEFT_AND_DOWN |
13 | GESTURE_SWIPE_RIGHT_AND_UP |
14 | GESTURE_SWIPE_RIGHT_AND_DOWN |
15 | GESTURE_SWIPE_UP_AND_LEFT |
16 | GESTURE_SWIPE_UP_AND_RIGHT |
17 | GESTURE_SWIPE_DOWN_AND_LEFT |
18 | GESTURE_SWIPE_DOWN_AND_RIGHT |
ArrayList<Prediction> predictions = mGestureLibrary.recognize(gesture);
if (!predictions.isEmpty()) {
Prediction bestPrediction = predictions.get(0);
if (bestPrediction.score >= MIN_PREDICTION_SCORE) {
try {
final int gestureId = Integer.parseInt(bestPrediction.name);
Log.d(TAG, "gesture: " + gestureId);
if (gestureId > 4 && gestureId < 11 && hold < 2) posReveal(!reveal);
} catch (NumberFormatException nfe) {
Log.d(TAG, "Non numeric gesture id:" + bestPrediction.name);
}
}
}
gestureId > 4 && gestureId < 11