Skip to content

Instantly share code, notes, and snippets.

View DhruvDange's full-sized avatar
🎃

Dhruv DhruvDange

🎃
View GitHub Profile
@nerestaren
nerestaren / alphamap.js
Created March 21, 2018 10:40
A-FRAME Alpha Map
// This component adds an alpha map to a mesh.
AFRAME.registerComponent('alpha-map', {
schema: {
src: {type: 'map'}
},
init: function() {
this.el.sceneEl.systems.material.loadTexture(this.data.src, {src: this.data.src}, this.callback.bind(this));
},
callback: function(texture) {