diff --git a/example/assets/index.glb b/example/assets/index.glb index f27e8b5..4988b4c 100644 Binary files a/example/assets/index.glb and b/example/assets/index.glb differ diff --git a/src/3rd/js/three/xrf/src.js b/src/3rd/js/three/xrf/src.js index 2ffb34d..e41682c 100644 --- a/src/3rd/js/three/xrf/src.js +++ b/src/3rd/js/three/xrf/src.js @@ -6,8 +6,17 @@ xrf.frag.src = function(v, opts){ if( mesh.isSRC ) return // only embed src once + // correct for relative urls + if( v.string.charAt(0) != '#' && xrf.URI.isRelative( xrf.URI.parse( v.string ) ) ){ + console.log("-"+v.string.charAt(0)+"-") + console.log(v.string) + v.string = xrf.navigator.URI.URN + v.string + console.log(v.string) + } + let url = xrf.frag.src.expandURI( mesh, v.string ) let srcFrag = opts.srcFrag = xrfragment.URI.parse(url).XRF + opts.isLocal = v.string[0] == '#' opts.isPortal = xrf.frag.src.renderAsPortal(mesh) opts.isSRC = mesh.isSRC = true diff --git a/src/3rd/js/three/xrf/src/glsl.js b/src/3rd/js/three/xrf/src/glsl.js index 52c6940..9748bae 100644 --- a/src/3rd/js/three/xrf/src/glsl.js +++ b/src/3rd/js/three/xrf/src/glsl.js @@ -19,6 +19,7 @@ xrf.frag.src.type['x-shader/x-fragment'] = function(url,opts){ } var onShaderLoaded = ((args) => (type, status, code) => { + if( !code ) return console.error('could not load shader') shader[type].status = status shader[type].code = code if( shader.fragment.code && shader.vertex.code ){