bugfix: relative urls work now
This commit is contained in:
parent
c102562736
commit
d07e1f9feb
Binary file not shown.
|
@ -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
|
||||
|
|
|
@ -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 ){
|
||||
|
|
Loading…
Reference in New Issue