Sha256: 2402f46ab43f189973fdc0246a8dacb179004be35d6b6ac6eee672e963a7d4f4

Contents?: true

Size: 667 Bytes

Versions: 13

Compression:

Stored size: 667 Bytes

Contents

Jax.Material.Texture = Jax.Class.create(Jax.Material, {
  initialize: function($super, texture) {
    this.texture = Jax.Material.Texture.normalizeTexture(texture);
    $super({shader:"texture"});
  },
  
  setVariables: function(context, mesh, options, vars) {
    vars.texture('Texture', this.texture, context);
    vars.set('TextureScaleX', this.texture.options.scale_x || this.texture.options.scale || 1);
    vars.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

13 entries across 13 versions & 1 rubygems

Version Path
jax-2.0.12 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.11 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.10 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.9 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.8 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.7 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.6 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.5 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.4 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.3 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.2 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.1 lib/assets/javascripts/shaders/texture/material.js
jax-2.0.0 lib/assets/javascripts/shaders/texture/material.js