From 03d2653bd724b11dcdadba5d56ab5a854f9c6583 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Mon, 29 Apr 2024 18:24:46 +0200 Subject: [PATCH] fix visualizers for static vsa --- editor/visualizers/effects/VSAEffect.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/visualizers/effects/VSAEffect.js b/editor/visualizers/effects/VSAEffect.js index 51e0494..ff45736 100644 --- a/editor/visualizers/effects/VSAEffect.js +++ b/editor/visualizers/effects/VSAEffect.js @@ -286,7 +286,7 @@ export default class VSAEffect { async setURL(url) { try { const u = new URL(url, window.location.href); - if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com') { + if (u.hostname !== window.location.hostname && u.hostname !== 'www.vertexshaderart.com' && u.hostname !== 'vertexshaderart.com') { return; } if (url === this.currentUrl) { @@ -305,7 +305,10 @@ export default class VSAEffect { this.currentUrl = this.pendingUrl; this.pendingUrl = undefined; this.compiling = true; - const req = await fetch(`${url}?format=json`); + const mungedUrl = url.includes('vertexshaderart.com') + ? `${url.replace('//www.', '//')}/art.json` + : url; + const req = await fetch(mungedUrl); const vsa = await req.json(); const gl = this.gl; const vs = applyTemplateToShader(vsa.settings.shader);