Sha256: bcea686d564382fd967f02ee1ec030b744ce0842bc60923769f1fa13d065f490

Contents?: true

Size: 736 Bytes

Versions: 17

Compression:

Stored size: 736 Bytes

Contents

Jax.Material.Texture = Jax.Class.create(Jax.Material, {
  initialize: function($super, texture) {
    this.texture = Jax.Material.Texture.normalizeTexture(texture);
    $super({shader:"texture"});
  },
  
  setUniforms: function($super, context, mesh, options, uniforms) {
    $super(context, mesh, options, uniforms);
    uniforms.texture('Texture', this.texture, context);
    uniforms.set('TextureScaleX', this.texture.options.scale_x || this.texture.options.scale || 1);
    uniforms.set('TextureScaleY', this.texture.options.scale_y || this.texture.options.scale || 1);
  }
});

Jax.Material.Texture.normalizeTexture = function(tex) {
  if (tex.isKindOf && tex.isKindOf(Jax.Texture)) return tex;
  return new Jax.Texture(tex); 
};

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
jax-1.1.1 builtin/app/shaders/texture/material.js
jax-1.1.0 builtin/app/shaders/texture/material.js
jax-1.1.0.rc1 builtin/app/shaders/texture/material.js
jax-1.0.1 builtin/shaders/texture/material.js
jax-1.0.1.rc2 builtin/shaders/texture/material.js
jax-1.0.1.rc1 builtin/shaders/texture/material.js
jax-1.0.0 builtin/shaders/texture/material.js
jax-0.0.0.10 builtin/shaders/texture/material.js
jax-0.0.0.9 builtin/shaders/texture/material.js
jax-0.0.0.8 builtin/shaders/texture/material.js
jax-0.0.0.7 builtin/shaders/texture/material.js
jax-0.0.0.6 builtin/shaders/texture/material.js
jax-0.0.0.5 builtin/shaders/texture/material.js
jax-0.0.0.4 builtin/shaders/texture/material.js
jax-0.0.0.3 builtin/shaders/texture/material.js
jax-0.0.0.2 builtin/shaders/texture/material.js
jax-0.0.0.1 builtin/shaders/texture/material.js