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
//npm install underscore | |
var plask = require('plask'); | |
_ = require('underscore'); | |
plask.simpleWindow({ | |
init: function() { | |
this.framerate(60); | |
this.paint.setFill(); // Fill is the default, so this is just for clarity. | |
this.paint.setAntiAlias(true); | |
}, |
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
#ifdef GL_ES | |
precision highp float; | |
#endif | |
varying vec4 vColor; | |
void main(void) { | |
gl_FragColor = vColor; | |
} |
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
//Learning WebGL for Plask Lesson16 | |
//Learing WebGL : http://learningwebgl.com/blog/?page_id=1217 | |
//Github : https://github.com/gpjt/webgl-lessons (this script use 'earth.jpg' , 'crate.gif' and 'macbook.json') | |
// | |
//Plask : http://www.plask.org/ | |
// | |
//俺俺でMat3とMat4.toInverseMat3()あたりを追記したものを使ってやりました。 | |
//元のplask.jsと区別つけるために同一フォルダから読み込むようにしてます。 | |
//尚、binary版とgithubの最新版で微妙にplask.jsの変更があるみたいなので、 | |
//plask_.js binary版用、plask.js github用としてます。 |
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
//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' and 'earth-specular.gif') | |
// | |
//KeyMap | |
//zoom : qe, | |
//lighting : t, | |
//colorMap : y | |
//useColorMap : u, | |
//reset : r, |
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
//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, | |
// |
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
//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: |
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
//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に平行光の色だけ割り当ててます。 | |
// |
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
#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)); |
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
#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)); |
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
#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)); | |
} |
NewerOlder