Skip to content

Instantly share code, notes, and snippets.

@prestomation
Created November 14, 2018 07:39
Show Gist options
  • Save prestomation/19800cb3c5a3b9e9a33d7cf845e5f40f to your computer and use it in GitHub Desktop.
Save prestomation/19800cb3c5a3b9e9a33d7cf845e5f40f to your computer and use it in GitHub Desktop.
Sumerian: Set texture from a URL
const material = ctx.entity.getComponent("MeshRendererComponent").materials[0];
new sumerian.TextureCreator().loadTexture2D("https://images-na.ssl-images-amazon.com/images/G/01/support_images/GUID-15BCCE28-8970-45C8-BF29-5F9FBF2293B5_en-US.png").then(texture =>{
material.setTexture("DIFFUSE_MAP", texture);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment