Skip to content

Instantly share code, notes, and snippets.

@noboko
noboko / app.fshader
Created March 29, 2012 12:46
Learning WebGL for Plask Lesson05
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.fshader
Created March 30, 2012 19:14
Learning WebGL for Plask Lesson 06
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.fshader
Created April 2, 2012 13:32
Learning WebGL for Plask Lesson 8
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
uniform float uAlpha;
uniform sampler2D uSampler;
@noboko
noboko / app.fshader
Created April 5, 2012 15:50
Learning WebGL for Plask Lesson 09
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec3 uColor;
@noboko
noboko / app.fshader
Created April 7, 2012 14:08
Learning WebGL for Plask Lesson 10
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
void main(void) {
gl_FragColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
}
@noboko
noboko / app.fshader
Created April 9, 2012 11:45
Learning WebGL for Plask Lesson 11
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
uniform sampler2D uSampler;
void main(void) {
vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.fshader
Created April 11, 2012 17:24
Learning WebGL for Plask Lesson12
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec3 vLightWeighting;
uniform sampler2D uSampler;
void main(void) {
vec4 textureColor = texture2D(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));
@noboko
noboko / app.js
Created April 12, 2012 13:43
Learning WebGL for Plask Lesson 13
//Learning WebGL for Plask Lesson13
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'moon.gif' & 'crate.gif'.)
//zoom : qe,
//lighting : v,
//useFragmentLighting : f
//useTexture : c,
//reset : r を割り当ててます。
//plaskで入力エリアを作る方法が無さげなのでtgyhujに平行光の色だけ割り当ててます。
//
//Mat3 for Plask
//Add your plask.js
////////Change your plask.js makeSetter and add exports.Mat3//////////////
function makeSetter(type, loc) {
switch (type) {
case gl.BOOL: // NOTE: bool could be set with 1i or 1f.
case gl.INT:
case gl.SAMPLER_2D:
@noboko
noboko / app.js
Created April 14, 2012 11:46
Learning WebGL for Plask lesson 14
//Learning WebGL for Plask Lesson14
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217
//Github : https://github.com/gpjt/webgl-lessons (this script use 'earth.jpg' , 'arroway.de_metal+structure+06_d100_flat.jpg' and 'Teapot.json')
//zoom : qe,
//lighting : v,
//useFragmentLighting : f
//useTexture : c,
//reset : r,
//specularColor : tgyhuj,
//