Skip to content

Instantly share code, notes, and snippets.

View DhruvDange's full-sized avatar
🎃

Dhruv DhruvDange

🎃
View GitHub Profile
@DhruvDange
DhruvDange / alphamap.js
Created January 23, 2023 15:21 — forked from nerestaren/alphamap.js
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) {