Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from dawidgorny/master
Browse files Browse the repository at this point in the history
Added offset uniform to Textured material
  • Loading branch information
vorg committed Oct 26, 2014
2 parents c790d3a + f0abfca commit 1a82df9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/Textured.glsl
Expand Up @@ -2,13 +2,15 @@

uniform mat4 projectionMatrix;
uniform mat4 modelViewMatrix;
uniform vec2 offset;
attribute vec3 position;
attribute vec2 texCoord;
varying vec2 vTexCoord;

void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
vTexCoord = texCoord;
vTexCoord += offset;
}

#endif
Expand Down
3 changes: 2 additions & 1 deletion lib/Textured.js
Expand Up @@ -16,7 +16,8 @@ function Textured(uniforms) {
var program = new Program(TexturedGLSL);
var defaults = {
scale: new Vec2(1, 1),
color: new Color(1, 1, 1, 1)
color: new Color(1, 1, 1, 1),
offset: new Vec2(0,0)
};
uniforms = merge(defaults, uniforms);
Material.call(this, program, uniforms);
Expand Down

0 comments on commit 1a82df9

Please sign in to comment.