Skip to content

Instantly share code, notes, and snippets.

@akshayloke
akshayloke / RGBtoI420.frag
Created October 7, 2016 16:36
Implementation for converting RGB data to YUV I420 data. Very useful when you want to encode RGB video feed for writing to file or sending over WebRTC..
varying lowp vec2 vUV;
uniform sampler2D compositeTexture;
uniform highp vec2 screenSize;
uniform highp vec2 halfScreenSize;
uniform highp vec2 doubleScreenSize;
uniform highp vec2 invScreenSize;
uniform highp vec3 numYUVPixels;
@akshayloke
akshayloke / Spiral-clean.frag
Created September 23, 2016 21:35
Cleaner implementation of the Spiral fragment shader
// Author: Akshay S. Loke
// Title: Spiral
#ifdef GL_ES
precision mediump float;
#endif
#define USE_SMOOTH
#define M_PI 3.14159265358979
#define M_2PI 6.28318530717958
@akshayloke
akshayloke / Spiral.frag
Last active August 11, 2016 04:49
Spiral.frag shader using editor.thebookofshaders.com
// Author:
// Title:
#ifdef GL_ES
precision mediump float;
#endif
#define M_PI 3.14159265358979
#define M_2PI 6.28318530717958
#define RADIUS 100.0