diff --git a/doc/RFC_XR_Fragments.html b/doc/RFC_XR_Fragments.html index b3277ef..998c549 100644 --- a/doc/RFC_XR_Fragments.html +++ b/doc/RFC_XR_Fragments.html @@ -497,16 +497,44 @@ That way, if the link gets shared, the XR Fragments implementation at http temporal W3C media fragment * -t=x,y, … -0,1,4,5 -XD parameters: pass values as positional uniform values to shader (if loaded with src) +t=[uv:][l:][pl:]x,y,… +0,1,4,5 +XD parameters: play [or scroll uvcoordinates] [as loop] or [as pingpongloop] between x and y + + + + + + +more args (...) means passing all values as positional uniform values to shader in case its loaded with src) + + + + + + +uv-coordinate playback equals U = xywh.x + (t.x*(s.x/fps)) and V = t.y*(s.y/fps) temporal W3C media fragment * -s=x,y, … -1,1,1,1 -XD speed: set playback speed of audio/video (or uv-coordinate texturescroll) +s=[uv:]x, … +1,1,1,1 +XD speed: set playback speed of audio/video [or uv-coordinates] + + + + + +uv:1,1 +(texture)scroll uv-coordinates with 0.1 units/per second + + + +temporal W3C media fragment +xywh=x,y,w,h +0,0,1,1 +crop (uv) coordinates (default for uv-coordinates is 0,0,1,1) @@ -525,24 +553,34 @@ That way, if the link gets shared, the XR Fragments implementation at http -multidimensional values beyond t=x,y -allows passing temporal mediafragment values as shader-uniforms (like IFS parameters). +l: specifices loop +t=0,2 specifies oneshot-play (default) whereas t=l:0,2 indicates looped-play - -The temporal relationship is that shaders are ‘players’ too, but which require loose-coupled positional values (parameters) for temporal control (like IFS parameters) +pl: specifices pingpongloop +t=0,2 specifies oneshot-play (default) whereas t=pl:0,2 indicates looped-play -~ specifies loop -t=0,2 specifies oneshot-play (default) whereas t=~0,2 indicates looped-play +uv: specifies uv-coordinates +t=0,2 specifies src loaded media (or 3D animations in 3D models) whereas t=uv:0,1 plays uv-coordinate texturescroller s specifies speed being able to specify loop(speed) of audio/video/uv timeline-coordinates which is 1,[[1],[1]] by default (translates to uv-coordinate 0.1 units p/second) + + +t=x,y,... forwarded as shadervalues +t=x,y,... values are forwarded as positional shader-uniform values (like IFS parameters). + + + + +The rationale that shaders are temporal ‘players’ too, but which require loose-coupled positional values (parameters) for temporal control (like IFS parameters) + @@ -557,23 +595,22 @@ That way, if the link gets shared, the XR Fragments implementation at http │ │ └ href: #media.play&wall.calm │ trigger #play on object 'media' and #calm on 'wall' │ │ │ │ ├── ◻ plane │ - │ │ └ src: foo.jpg#t=~0,0.2&xywh=0.2,0.2,0.4,0.4 │ texturescroll between uv-coordinate `0.2,0.2` and `0.4,0.4` + │ │ └ src: foo.jpg#t=uv:l:0,0.2&s=1 │ infinite texturescroll `v` of uv-coordinates with 0.2/fps │ │ │ with u-speed `0.1` and v-speed `0.1` (`#s` defaults) units p/second - │ │ │ │ ├── ◻ media │ │ │ ├ play: #t=0 │ play cat.mp4 from 0 sec │ │ ├ stop: #t=0,0 │ stop - │ │ ├ loop: #t=~1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed + │ │ ├ loop: #t=l:1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed │ │ ├ crop: #xywh=0,0,0.5,0.5 │ crop uv-coordinates │ │ ├ #: #play │ apply default XR fragment (on load) │ │ │ │ - │ │ └ src: cat.mp4#t=~2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds + │ │ └ src: cat.mp4#t=l:2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds │ │ │ │ └── ◻ wall │ │ ├ href: #calm │ - │ ├ calm: #t=1,2,3,4 >-----+--> updates uniform values (IFS shader e.g.) - │ ├ #: #calm │ apply default XR Fragment (on load) - │ └ src: ://a.com/art.fs#t=0,0,0,0 │ .fs/.vs/.glsl/.wgsl etc + │ ├ calm: #t=1,2,3,4 >--+--+--> updates uniform values (IFS shader e.g.) + │ ├ #: #calm | │ apply default XR Fragment (on load) + │ └ src: ://a.com/art.fs#t=0,0,0,0 >--- │ .fs/.vs/.glsl/.wgsl etc │ │ │ │ +──────────────────────────────────────────────────────────+ diff --git a/doc/RFC_XR_Fragments.md b/doc/RFC_XR_Fragments.md index 37eceed..02703ef 100644 --- a/doc/RFC_XR_Fragments.md +++ b/doc/RFC_XR_Fragments.md @@ -266,23 +266,29 @@ These are automatic fragment-to-metadata mappings, which only trigger if the 3D > NOTE: below the word 'play' applies to 3D animations embedded in the 3D scene(file) **but also** media defined in `src`-metadata like audio/video-files (mp3/mp4 e.g.) | type | syntax | example | info | -|-------------------------------|-----------------------------|-----------------|----------------------| -| vector2 | x,y | 2,3.0 | 2-dimensional vector | -| vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector | -| temporal W3C media fragment | t=x | 0 | 1D parameters: play from 0 seconds to end (and stop) | -| temporal W3C media fragment | t=x,y | 0,2 | 1D parameters: play from 0 seconds till 2 seconds (and stop) | -| temporal W3C media fragment * | t=x,y, ... | 0,1,4,5 | XD parameters: pass values as positional uniform values to shader (if loaded with `src`) | -| temporal W3C media fragment * | s=x,y, ... | 1,1,1,1 | XD speed: set playback speed of audio/video (or uv-coordinate texturescroll) | +|-------------------------------|------------------------|-----------------|----------------------| +| vector2 | x,y | 2,3.0 | 2-dimensional vector | +| vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector | +| temporal W3C media fragment | t=x | 0 | 1D parameters: play from 0 seconds to end (and stop) | +| temporal W3C media fragment | t=x,y | 0,2 | 1D parameters: play from 0 seconds till 2 seconds (and stop) | +| temporal W3C media fragment * | t=[uv:][l:]x,y,... | l:0,1,4,5 | XD parameters: play [or scroll uvcoordinates] [as loop] between `x` and `y` | +| | | | more args (`...`) means passing all values as positional uniform values to shader in case its loaded with `src`) | +| | | | uv-coordinate playback equals `U = xywh.x + (t.x*(s.x/fps))` and `V = t.y*(s.y/fps)` | +| temporal W3C media fragment * | s=[uv:]x, ... | 1,1,1,1 | XD speed: set playback speed of audio/video [or uv-coordinates] | +| | | uv:1,1 | (texture)scroll uv-coordinates with `0.1` units/per second | +| temporal W3C media fragment | xywh=x,y,w,h | 0,0,1,1 | crop (uv) coordinates (default for uv-coordinates is `0,0,1,1`) | + > \* = this is extending the [W3C media fragments](https://www.w3.org/TR/media-frags/#mf-advanced) with: | extension | info | |------------------|---------| -| multidimensional values beyond `t=x,y` | allows passing temporal mediafragment values as shader-uniforms (like [IFS parameters](https://isf.video/)). | -| | The temporal relationship is that shaders are 'players' too, but which require loose-coupled positional values (parameters) for temporal control (like [IFS parameters](https://isf.video/)) | -| `~` specifies loop | `t=0,2` specifies oneshot-play (default) whereas `t=~0,2` indicates looped-play | +| `l:` specifices loop | `t=0,2` specifies oneshot-play (default) whereas `t=l:0,2` indicates looped-play | +| `uv:` specifies uv-coordinates | `t=0,2` specifies `src` loaded media (or 3D animations in 3D models) whereas `t=uv:0,1` plays uv-coordinate texturescroller | | `s` specifies speed | being able to specify loop(speed) of audio/video/uv timeline-coordinates which is `1,[[1],[1]]` by default (translates to uv-coordinate `0.1` units p/second) | +| `t=x,y,...` forwarded as shadervalues | `t=x,y,...` values are forwarded as positional shader-uniform values (like [IFS parameters](https://isf.video/)). | +| | The rationale that shaders are temporal 'players' too, but which require loose-coupled positional values (parameters) for temporal control (like [IFS parameters](https://isf.video/)) | ``` @@ -297,23 +303,22 @@ These are automatic fragment-to-metadata mappings, which only trigger if the 3D │ │ └ href: #media.play&wall.calm │ trigger #play on object 'media' and #calm on 'wall' │ │ │ │ ├── ◻ plane │ - │ │ └ src: foo.jpg#t=~0,0.2&xywh=0.2,0.2,0.4,0.4 │ texturescroll between uv-coordinate `0.2,0.2` and `0.4,0.4` + │ │ └ src: foo.jpg#t=uv:l:0,0.2&s=1 │ infinite texturescroll `v` of uv-coordinates with 0.2/fps │ │ │ with u-speed `0.1` and v-speed `0.1` (`#s` defaults) units p/second - │ │ │ │ ├── ◻ media │ │ │ ├ play: #t=0 │ play cat.mp4 from 0 sec │ │ ├ stop: #t=0,0 │ stop - │ │ ├ loop: #t=~1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed + │ │ ├ loop: #t=l:1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed │ │ ├ crop: #xywh=0,0,0.5,0.5 │ crop uv-coordinates │ │ ├ #: #play │ apply default XR fragment (on load) │ │ │ │ - │ │ └ src: cat.mp4#t=~2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds + │ │ └ src: cat.mp4#t=l:2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds │ │ │ │ └── ◻ wall │ │ ├ href: #calm │ - │ ├ calm: #t=1,2,3,4 >-----+--> updates uniform values (IFS shader e.g.) - │ ├ #: #calm │ apply default XR Fragment (on load) - │ └ src: ://a.com/art.fs#t=0,0,0,0 │ .fs/.vs/.glsl/.wgsl etc + │ ├ calm: #t=1,2,3,4 >--+--+--> updates uniform values (IFS shader e.g.) + │ ├ #: #calm | │ apply default XR Fragment (on load) + │ └ src: ://a.com/art.fs#t=0,0,0,0 >--- │ .fs/.vs/.glsl/.wgsl etc │ │ │ │ +──────────────────────────────────────────────────────────+ diff --git a/doc/RFC_XR_Fragments.txt b/doc/RFC_XR_Fragments.txt index e7add0f..7115c8f 100644 --- a/doc/RFC_XR_Fragments.txt +++ b/doc/RFC_XR_Fragments.txt @@ -77,33 +77,33 @@ Table of Contents 4.1. List of metadata for 3D nodes . . . . . . . . . . . . . . 8 4.2. Dynamic XR Fragments (+databindings) . . . . . . . . . . 8 4.3. media fragments and datatypes . . . . . . . . . . . . . . 9 - 5. Spatial Referencing 3D . . . . . . . . . . . . . . . . . . . 12 - 6. Navigating 3D . . . . . . . . . . . . . . . . . . . . . . . . 13 - 7. Top-level URL processing . . . . . . . . . . . . . . . . . . 14 - 8. Embedding XR content using src . . . . . . . . . . . . . . . 15 - 9. Navigating content href portals . . . . . . . . . . . . . . . 17 - 9.1. Walking surfaces . . . . . . . . . . . . . . . . . . . . 19 - 9.2. UX spec . . . . . . . . . . . . . . . . . . . . . . . . . 19 - 9.3. Scaling instanced content . . . . . . . . . . . . . . . . 19 - 10. XR Fragment: pos . . . . . . . . . . . . . . . . . . . . . . 20 - 11. XR Fragment: rot . . . . . . . . . . . . . . . . . . . . . . 20 - 12. XR Fragment: t . . . . . . . . . . . . . . . . . . . . . . . 20 - 13. XR audio/video integration . . . . . . . . . . . . . . . . . 21 - 14. XR Fragment filters . . . . . . . . . . . . . . . . . . . . . 21 - 14.1. including/excluding . . . . . . . . . . . . . . . . . . 22 - 14.2. Filter Parser . . . . . . . . . . . . . . . . . . . . . 22 - 15. Visible links . . . . . . . . . . . . . . . . . . . . . . . . 23 - 16. Text in XR (tagging,linking to spatial objects) . . . . . . . 23 - 16.1. Default Data URI mimetype . . . . . . . . . . . . . . . 27 - 16.2. URL and Data URI . . . . . . . . . . . . . . . . . . . . 28 - 16.3. XR Text example parser . . . . . . . . . . . . . . . . . 29 - 17. Transclusion (broken link) resolution . . . . . . . . . . . . 31 - 18. Topic-based index-less Webrings . . . . . . . . . . . . . . . 32 - 19. Security Considerations . . . . . . . . . . . . . . . . . . . 33 - 20. FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 - 21. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 34 - 22. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 34 - 23. Appendix: Definitions . . . . . . . . . . . . . . . . . . . . 34 + 5. Spatial Referencing 3D . . . . . . . . . . . . . . . . . . . 13 + 6. Navigating 3D . . . . . . . . . . . . . . . . . . . . . . . . 14 + 7. Top-level URL processing . . . . . . . . . . . . . . . . . . 15 + 8. Embedding XR content using src . . . . . . . . . . . . . . . 16 + 9. Navigating content href portals . . . . . . . . . . . . . . . 18 + 9.1. Walking surfaces . . . . . . . . . . . . . . . . . . . . 20 + 9.2. UX spec . . . . . . . . . . . . . . . . . . . . . . . . . 20 + 9.3. Scaling instanced content . . . . . . . . . . . . . . . . 20 + 10. XR Fragment: pos . . . . . . . . . . . . . . . . . . . . . . 21 + 11. XR Fragment: rot . . . . . . . . . . . . . . . . . . . . . . 21 + 12. XR Fragment: t . . . . . . . . . . . . . . . . . . . . . . . 21 + 13. XR audio/video integration . . . . . . . . . . . . . . . . . 22 + 14. XR Fragment filters . . . . . . . . . . . . . . . . . . . . . 22 + 14.1. including/excluding . . . . . . . . . . . . . . . . . . 23 + 14.2. Filter Parser . . . . . . . . . . . . . . . . . . . . . 23 + 15. Visible links . . . . . . . . . . . . . . . . . . . . . . . . 24 + 16. Text in XR (tagging,linking to spatial objects) . . . . . . . 24 + 16.1. Default Data URI mimetype . . . . . . . . . . . . . . . 28 + 16.2. URL and Data URI . . . . . . . . . . . . . . . . . . . . 29 + 16.3. XR Text example parser . . . . . . . . . . . . . . . . . 30 + 17. Transclusion (broken link) resolution . . . . . . . . . . . . 32 + 18. Topic-based index-less Webrings . . . . . . . . . . . . . . . 33 + 19. Security Considerations . . . . . . . . . . . . . . . . . . . 34 + 20. FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 + 21. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35 + 22. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 35 + 23. Appendix: Definitions . . . . . . . . . . . . . . . . . . . . 35 @@ -506,29 +506,75 @@ van Kammen Expires 5 August 2024 [Page 9] Internet-Draft XR Fragments February 2024 - +================+========+=========+===============================+ - | type | syntax | example | info | - +================+========+=========+===============================+ - | vector2 | x,y | 2,3.0 | 2-dimensional vector | - +----------------+--------+---------+-------------------------------+ - | vector3 | x,y,z | 2,3.0,4 | 3-dimensional vector | - +----------------+--------+---------+-------------------------------+ - | temporal | t=x | 0 | 1D parameters: play from 0 | - | W3C media | | | seconds to end (and stop) | - | fragment | | | | - +----------------+--------+---------+-------------------------------+ - | temporal | t=x,y | 0,2 | 1D parameters: play from 0 | - | W3C media | | | seconds till 2 seconds (and | - | fragment | | | stop) | - +----------------+--------+---------+-------------------------------+ - | temporal | t=x,y, | 0,1,4,5 | XD parameters: pass values as | - | W3C media | ... | | positional uniform values to | - | fragment * | | | shader (if loaded with src) | - +----------------+--------+---------+-------------------------------+ - | temporal | s=x,y, | 1,1,1,1 | XD speed: set playback speed | - | W3C media | ... | | of audio/video (or uv- | - | fragment * | | | coordinate texturescroll) | - +----------------+--------+---------+-------------------------------+ + +========+=========================+============+=================+ + |type | syntax | example | info | + +========+=========================+============+=================+ + |vector2 | x,y | 2,3.0 | 2-dimensional | + | | | | vector | + +--------+-------------------------+------------+-----------------+ + |vector3 | x,y,z | 2,3.0,4 | 3-dimensional | + | | | | vector | + +--------+-------------------------+------------+-----------------+ + |temporal| t=x | 0 | 1D parameters: | + |W3C | | | play from 0 | + |media | | | seconds to end | + |fragment| | | (and stop) | + +--------+-------------------------+------------+-----------------+ + |temporal| t=x,y | 0,2 | 1D parameters: | + |W3C | | | play from 0 | + |media | | | seconds till 2 | + |fragment| | | seconds (and | + | | | | stop) | + +--------+-------------------------+------------+-----------------+ + |temporal| t=[uv:][l:][pl:]x,y,... | _(0,1,4,5) | XD parameters: | + |W3C | | | play [or scroll | + |media | | | uvcoordinates] | + |fragment| | | [as loop] or | + |* | | | [as | + | | | | pingpongloop] | + | | | | between x and y | + +--------+-------------------------+------------+-----------------+ + | | | | more args (...) | + | | | | means passing | + | | | | all values as | + | | | | positional | + | | | | uniform values | + | | | | to shader in | + | | | | case its loaded | + | | | | with src) | + +--------+-------------------------+------------+-----------------+ + | | | | uv-coordinate | + | | | | playback equals | + | | | | U = xywh.x + | + | | | | (t.x*(s.x/fps)) | + | | | | and V = | + | | | | t.y*(s.y/fps) | + +--------+-------------------------+------------+-----------------+ + |temporal| s=[uv:]x, ... | _(1,1,1,1) | XD speed: set | + |W3C | | | playback speed | + |media | | | of audio/video | + |fragment| | | [or uv- | + + + +van Kammen Expires 5 August 2024 [Page 10] + +Internet-Draft XR Fragments February 2024 + + + |* | | | coordinates] | + +--------+-------------------------+------------+-----------------+ + | | | uv:1,1 | (texture)scroll | + | | | | uv-coordinates | + | | | | with 0.1 units/ | + | | | | per second | + +--------+-------------------------+------------+-----------------+ + |temporal| xywh=x,y,w,h | 0,0,1,1 | crop (uv) | + |W3C | | | coordinates | + |media | | | (default for | + |fragment| | | uv-coordinates | + | | | | is 0,0,1,1) | + +--------+-------------------------+------------+-----------------+ Table 6 @@ -554,52 +600,6 @@ Internet-Draft XR Fragments February 2024 - - - -van Kammen Expires 5 August 2024 [Page 10] - -Internet-Draft XR Fragments February 2024 - - - +==================+=========================================+ - | extension | info | - +==================+=========================================+ - | multidimensional | allows passing temporal mediafragment | - | values beyond | values as shader-uniforms (like IFS | - | t=x,y | parameters (https://isf.video/)). | - +------------------+-----------------------------------------+ - | | The temporal relationship is that | - | | shaders are 'players' too, but which | - | | require loose-coupled positional values | - | | (parameters) for temporal control (like | - | | IFS parameters (https://isf.video/)) | - +------------------+-----------------------------------------+ - | ~ specifies loop | t=0,2 specifies oneshot-play (default) | - | | whereas t=~0,2 indicates looped-play | - +------------------+-----------------------------------------+ - | s specifies | being able to specify loop(speed) of | - | speed | audio/video/uv timeline-coordinates | - | | which is 1,[[1],[1]] by default | - | | (translates to uv-coordinate 0.1 units | - | | p/second) | - +------------------+-----------------------------------------+ - - Table 7 - - - - - - - - - - - - - - @@ -618,6 +618,62 @@ van Kammen Expires 5 August 2024 [Page 11] Internet-Draft XR Fragments February 2024 + +================+===========================================+ + | extension | info | + +================+===========================================+ + | l: specifices | t=0,2 specifies oneshot-play (default) | + | loop | whereas t=l:0,2 indicates looped-play | + +----------------+-------------------------------------------+ + | pl: specifices | t=0,2 specifies oneshot-play (default) | + | pingpongloop | whereas t=pl:0,2 indicates looped-play | + +----------------+-------------------------------------------+ + | uv: specifies | t=0,2 specifies src loaded media (or 3D | + | uv-coordinates | animations in 3D models) whereas t=uv:0,1 | + | | plays uv-coordinate texturescroller | + +----------------+-------------------------------------------+ + | s specifies | being able to specify loop(speed) of | + | speed | audio/video/uv timeline-coordinates which | + | | is 1,[[1],[1]] by default (translates to | + | | uv-coordinate 0.1 units p/second) | + +----------------+-------------------------------------------+ + | t=x,y,... | t=x,y,... values are forwarded as | + | forwarded as | positional shader-uniform values (like | + | shadervalues | IFS parameters (https://isf.video/)). | + +----------------+-------------------------------------------+ + | | The rationale that shaders are temporal | + | | 'players' too, but which require loose- | + | | coupled positional values (parameters) | + | | for temporal control (like IFS parameters | + | | (https://isf.video/)) | + +----------------+-------------------------------------------+ + + Table 7 + + + + + + + + + + + + + + + + + + + + + +van Kammen Expires 5 August 2024 [Page 12] + +Internet-Draft XR Fragments February 2024 + + +──────────────────────────────────────────────────────────+ │ │ │ index.gltf#playall │ @@ -629,23 +685,22 @@ Internet-Draft XR Fragments February 2024 │ │ └ href: #media.play&wall.calm │ trigger #play on object 'media' and #calm on 'wall' │ │ │ │ ├── ◻ plane │ - │ │ └ src: foo.jpg#t=~0,0.2&xywh=0.2,0.2,0.4,0.4 │ texturescroll between uv-coordinate `0.2,0.2` and `0.4,0.4` + │ │ └ src: foo.jpg#t=uv:l:0,0.2&s=1 │ infinite texturescroll `v` of uv-coordinates with 0.2/fps │ │ │ with u-speed `0.1` and v-speed `0.1` (`#s` defaults) units p/second - │ │ │ │ ├── ◻ media │ │ │ ├ play: #t=0 │ play cat.mp4 from 0 sec │ │ ├ stop: #t=0,0 │ stop - │ │ ├ loop: #t=~1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed + │ │ ├ loop: #t=l:1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed │ │ ├ crop: #xywh=0,0,0.5,0.5 │ crop uv-coordinates │ │ ├ #: #play │ apply default XR fragment (on load) │ │ │ │ - │ │ └ src: cat.mp4#t=~2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds + │ │ └ src: cat.mp4#t=l:2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds │ │ │ │ └── ◻ wall │ │ ├ href: #calm │ - │ ├ calm: #t=1,2,3,4 >-----+--> updates uniform values (IFS shader e.g.) - │ ├ #: #calm │ apply default XR Fragment (on load) - │ └ src: ://a.com/art.fs#t=0,0,0,0 │ .fs/.vs/.glsl/.wgsl etc + │ ├ calm: #t=1,2,3,4 >--+--+--> updates uniform values (IFS shader e.g.) + │ ├ #: #calm | │ apply default XR Fragment (on load) + │ └ src: ://a.com/art.fs#t=0,0,0,0 >--- │ .fs/.vs/.glsl/.wgsl etc │ │ │ │ +──────────────────────────────────────────────────────────+ @@ -669,7 +724,8 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 12] + +van Kammen Expires 5 August 2024 [Page 13] Internet-Draft XR Fragments February 2024 @@ -725,7 +781,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 13] +van Kammen Expires 5 August 2024 [Page 14] Internet-Draft XR Fragments February 2024 @@ -781,7 +837,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 14] +van Kammen Expires 5 August 2024 [Page 15] Internet-Draft XR Fragments February 2024 @@ -837,7 +893,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 15] +van Kammen Expires 5 August 2024 [Page 16] Internet-Draft XR Fragments February 2024 @@ -893,7 +949,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 16] +van Kammen Expires 5 August 2024 [Page 17] Internet-Draft XR Fragments February 2024 @@ -949,7 +1005,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 17] +van Kammen Expires 5 August 2024 [Page 18] Internet-Draft XR Fragments February 2024 @@ -1005,7 +1061,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 18] +van Kammen Expires 5 August 2024 [Page 19] Internet-Draft XR Fragments February 2024 @@ -1061,7 +1117,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 19] +van Kammen Expires 5 August 2024 [Page 20] Internet-Draft XR Fragments February 2024 @@ -1117,7 +1173,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 20] +van Kammen Expires 5 August 2024 [Page 21] Internet-Draft XR Fragments February 2024 @@ -1173,7 +1229,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 21] +van Kammen Expires 5 August 2024 [Page 22] Internet-Draft XR Fragments February 2024 @@ -1229,7 +1285,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 22] +van Kammen Expires 5 August 2024 [Page 23] Internet-Draft XR Fragments February 2024 @@ -1285,7 +1341,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 23] +van Kammen Expires 5 August 2024 [Page 24] Internet-Draft XR Fragments February 2024 @@ -1341,7 +1397,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 24] +van Kammen Expires 5 August 2024 [Page 25] Internet-Draft XR Fragments February 2024 @@ -1397,7 +1453,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 25] +van Kammen Expires 5 August 2024 [Page 26] Internet-Draft XR Fragments February 2024 @@ -1453,7 +1509,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 26] +van Kammen Expires 5 August 2024 [Page 27] Internet-Draft XR Fragments February 2024 @@ -1509,7 +1565,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 27] +van Kammen Expires 5 August 2024 [Page 28] Internet-Draft XR Fragments February 2024 @@ -1565,7 +1621,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 28] +van Kammen Expires 5 August 2024 [Page 29] Internet-Draft XR Fragments February 2024 @@ -1621,7 +1677,7 @@ xrtext = { -van Kammen Expires 5 August 2024 [Page 29] +van Kammen Expires 5 August 2024 [Page 30] Internet-Draft XR Fragments February 2024 @@ -1677,7 +1733,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 30] +van Kammen Expires 5 August 2024 [Page 31] Internet-Draft XR Fragments February 2024 @@ -1733,7 +1789,7 @@ console.log( xrtext.encode(text,tags) ) // multiplex text & bibtex back to -van Kammen Expires 5 August 2024 [Page 31] +van Kammen Expires 5 August 2024 [Page 32] Internet-Draft XR Fragments February 2024 @@ -1789,7 +1845,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 32] +van Kammen Expires 5 August 2024 [Page 33] Internet-Draft XR Fragments February 2024 @@ -1845,7 +1901,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 33] +van Kammen Expires 5 August 2024 [Page 34] Internet-Draft XR Fragments February 2024 @@ -1901,7 +1957,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 34] +van Kammen Expires 5 August 2024 [Page 35] Internet-Draft XR Fragments February 2024 @@ -1957,7 +2013,7 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 35] +van Kammen Expires 5 August 2024 [Page 36] Internet-Draft XR Fragments February 2024 @@ -2013,4 +2069,4 @@ Internet-Draft XR Fragments February 2024 -van Kammen Expires 5 August 2024 [Page 36] +van Kammen Expires 5 August 2024 [Page 37] diff --git a/doc/RFC_XR_Fragments.xml b/doc/RFC_XR_Fragments.xml index 870b0ba..e5f15b9 100644 --- a/doc/RFC_XR_Fragments.xml +++ b/doc/RFC_XR_Fragments.xml @@ -403,16 +403,44 @@ That way, if the link gets shared, the XR Fragments implementation at https: temporal W3C media fragment * -t=x,y, ... -0,1,4,5 -XD parameters: pass values as positional uniform values to shader (if loaded with src) +t=[uv:][l:][pl:]x,y,... +0,1,4,5 +XD parameters: play [or scroll uvcoordinates] [as loop] or [as pingpongloop] between x and y + + + + + + +more args (...) means passing all values as positional uniform values to shader in case its loaded with src) + + + + + + +uv-coordinate playback equals U = xywh.x + (t.x*(s.x/fps)) and V = t.y*(s.y/fps) temporal W3C media fragment * -s=x,y, ... -1,1,1,1 -XD speed: set playback speed of audio/video (or uv-coordinate texturescroll) +s=[uv:]x, ... +1,1,1,1 +XD speed: set playback speed of audio/video [or uv-coordinates] + + + + + +uv:1,1 +(texture)scroll uv-coordinates with 0.1 units/per second + + + +temporal W3C media fragment +xywh=x,y,w,h +0,0,1,1 +crop (uv) coordinates (default for uv-coordinates is 0,0,1,1)
* = this is extending the W3C media fragments with: @@ -426,24 +454,34 @@ That way, if the link gets shared, the XR Fragments implementation at https: -multidimensional values beyond t=x,y -allows passing temporal mediafragment values as shader-uniforms (like IFS parameters). +l: specifices loop +t=0,2 specifies oneshot-play (default) whereas t=l:0,2 indicates looped-play - -The temporal relationship is that shaders are 'players' too, but which require loose-coupled positional values (parameters) for temporal control (like IFS parameters) +pl: specifices pingpongloop +t=0,2 specifies oneshot-play (default) whereas t=pl:0,2 indicates looped-play -~ specifies loop -t=0,2 specifies oneshot-play (default) whereas t=~0,2 indicates looped-play +uv: specifies uv-coordinates +t=0,2 specifies src loaded media (or 3D animations in 3D models) whereas t=uv:0,1 plays uv-coordinate texturescroller s specifies speed being able to specify loop(speed) of audio/video/uv timeline-coordinates which is 1,[[1],[1]] by default (translates to uv-coordinate 0.1 units p/second) + + +t=x,y,... forwarded as shadervalues +t=x,y,... values are forwarded as positional shader-uniform values (like IFS parameters). + + + + +The rationale that shaders are temporal 'players' too, but which require loose-coupled positional values (parameters) for temporal control (like IFS parameters) + https: │ │ └ href: #media.play&wall.calm │ trigger #play on object 'media' and #calm on 'wall' │ │ │ │ ├── ◻ plane │ - │ │ └ src: foo.jpg#t=~0,0.2&xywh=0.2,0.2,0.4,0.4 │ texturescroll between uv-coordinate `0.2,0.2` and `0.4,0.4` + │ │ └ src: foo.jpg#t=uv:l:0,0.2&s=1 │ infinite texturescroll `v` of uv-coordinates with 0.2/fps │ │ │ with u-speed `0.1` and v-speed `0.1` (`#s` defaults) units p/second - │ │ │ │ ├── ◻ media │ │ │ ├ play: #t=0 │ play cat.mp4 from 0 sec │ │ ├ stop: #t=0,0 │ stop - │ │ ├ loop: #t=~1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed + │ │ ├ loop: #t=l:1,2&s=2 │ loop cat.mp4 between 1 and 2 sec with double speed │ │ ├ crop: #xywh=0,0,0.5,0.5 │ crop uv-coordinates │ │ ├ #: #play │ apply default XR fragment (on load) │ │ │ │ - │ │ └ src: cat.mp4#t=~2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds + │ │ └ src: cat.mp4#t=l:2,10 │ loop cat.mp4 (or mp3/wav/jpg) between 2 and 10 seconds │ │ │ │ └── ◻ wall │ │ ├ href: #calm │ - │ ├ calm: #t=1,2,3,4 >-----+--> updates uniform values (IFS shader e.g.) - │ ├ #: #calm │ apply default XR Fragment (on load) - │ └ src: ://a.com/art.fs#t=0,0,0,0 │ .fs/.vs/.glsl/.wgsl etc + │ ├ calm: #t=1,2,3,4 >--+--+--> updates uniform values (IFS shader e.g.) + │ ├ #: #calm | │ apply default XR Fragment (on load) + │ └ src: ://a.com/art.fs#t=0,0,0,0 >--- │ .fs/.vs/.glsl/.wgsl etc │ │ │ │ +──────────────────────────────────────────────────────────+ diff --git a/doc/RFC_XR_Macros.txt b/doc/RFC_XR_Macros.txt index b9b2d0b..fb7ef97 100644 --- a/doc/RFC_XR_Macros.txt +++ b/doc/RFC_XR_Macros.txt @@ -3,7 +3,7 @@ Internet Engineering Task Force L.R. van Kammen -Internet-Draft 1 February 2024 +Internet-Draft 2 February 2024 Intended status: Informational @@ -38,7 +38,7 @@ Status of This Memo time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on 4 August 2024. + This Internet-Draft will expire on 5 August 2024. Copyright Notice @@ -53,7 +53,7 @@ Copyright Notice -van Kammen Expires 4 August 2024 [Page 1] +van Kammen Expires 5 August 2024 [Page 1] Internet-Draft XR Macros February 2024 @@ -109,7 +109,7 @@ Table of Contents -van Kammen Expires 4 August 2024 [Page 2] +van Kammen Expires 5 August 2024 [Page 2] Internet-Draft XR Macros February 2024 @@ -165,7 +165,7 @@ Internet-Draft XR Macros February 2024 -van Kammen Expires 4 August 2024 [Page 3] +van Kammen Expires 5 August 2024 [Page 3] Internet-Draft XR Macros February 2024 @@ -221,7 +221,7 @@ Internet-Draft XR Macros February 2024 -van Kammen Expires 4 August 2024 [Page 4] +van Kammen Expires 5 August 2024 [Page 4] Internet-Draft XR Macros February 2024 @@ -277,7 +277,7 @@ Internet-Draft XR Macros February 2024 -van Kammen Expires 4 August 2024 [Page 5] +van Kammen Expires 5 August 2024 [Page 5] Internet-Draft XR Macros February 2024 @@ -333,7 +333,7 @@ click object with (`!clickme`:`!foo|!bar|!flop` e.g.) -van Kammen Expires 4 August 2024 [Page 6] +van Kammen Expires 5 August 2024 [Page 6] Internet-Draft XR Macros February 2024 @@ -389,4 +389,4 @@ Internet-Draft XR Macros February 2024 -van Kammen Expires 4 August 2024 [Page 7] +van Kammen Expires 5 August 2024 [Page 7] diff --git a/example/assets/index.glb b/example/assets/index.glb index e1d857d..e3dc0a9 100644 Binary files a/example/assets/index.glb and b/example/assets/index.glb differ diff --git a/src/Test.hx b/src/Test.hx index a71d30d..5baca34 100644 --- a/src/Test.hx +++ b/src/Test.hx @@ -19,6 +19,7 @@ class Test { test( "pos.json", Spec.load("src/spec/pos.json") ); test( "t.json", Spec.load("src/spec/t.json") ); test( "xywh.json", Spec.load("src/spec/xywh.json") ); + test( "speed.json", Spec.load("src/spec/speed.json") ); test( "filter.selectors.json", Spec.load("src/spec/filter.selectors.json") ); //test( Spec.load("src/spec/tmp.json") ); if( errors > 1 ) trace("\n-----\n[ ❌] "+errors+" errors :/"); @@ -49,8 +50,7 @@ class Test { if( item.expect.fn == "equal.xyz" ) valid = equalXYZ(res,item); if( item.expect.fn == "equal.mediafragmentT" ) valid = equalMediaFragment(res,item,"t"); if( item.expect.fn == "equal.mediafragmentXYWH") valid = equalMediaFragment(res,item,"xywh"); - if( item.expect.fn == "equal.mediafragmentTSpd") valid = equalMediaFragmentSpd(res,item,"t"); - if( item.expect.fn == "equal.mediafragmentXYWHSpd") valid = equalMediaFragmentSpd(res,item,"xywh"); + if( item.expect.fn == "equal.mediafragmentSpeed") valid = equalMediaFragment(res,item,"speed"); if( item.expect.fn == "testFilterRoot" ) valid = res.exists(item.expect.input[0]) && res.get(item.expect.input[0]).filter.get().root == item.expect.out; if( item.expect.fn == "testFilterDeep" ) valid = res.exists(item.expect.input[0]) && res.get(item.expect.input[0]).filter.get().deep == item.expect.out; var ok:String = valid ? "[ ✔ ] " : "[ ❌] "; @@ -76,14 +76,7 @@ class Test { static public function equalMediaFragment(res:haxe.DynamicAccess, item:Dynamic, key:String):Bool { if( !item.expect.out && !res.get(item.expect.input) ) return true; - else return res.get( key ).floats[ Std.parseInt(item.expect.input) ] == Std.parseInt(item.expect.out); - } - - static public function equalMediaFragmentSpd(res:haxe.DynamicAccess, item:Dynamic, key:String ):Bool { - if( !item.expect.out && !res.get(item.expect.input) ) return true; - else{ - return res.get( key ).speed[ Std.parseInt(item.expect.input) ] == Std.parseFloat(item.expect.out); - } + else return res.get( key ).floats[ Std.parseInt(item.expect.input) ] == Std.parseFloat(item.expect.out); } static public function testUrl():Void { diff --git a/src/spec/speed.json b/src/spec/speed.json new file mode 100644 index 0000000..8a07397 --- /dev/null +++ b/src/spec/speed.json @@ -0,0 +1,3 @@ +[ + {"fn":"url","data":"http://foo.com?foo=1#speed=0,0,1.2,1", "expect":{ "fn":"equal.mediafragmentSpeed", "input":"2","out":"1.2"},"label":"speed"} +] diff --git a/src/spec/t.json b/src/spec/t.json index 8ebcd46..f8bbe67 100644 --- a/src/spec/t.json +++ b/src/spec/t.json @@ -7,6 +7,5 @@ {"fn":"url","data":"http://foo.com?foo=1#t=1,-2,3", "expect":{ "fn":"equal.xyz", "input":"t","out":"1,-2,3"},"label":"a equal.xyz"}, {"fn":"url","data":"http://foo.com?foo=1#t=1,100", "expect":{ "fn":"equal.xy", "input":"t","out":"1,100"},"label":"a equal.xy"}, {"fn":"url","data":"http://foo.com?foo=1#t=2,500", "expect":{ "fn":"testBrowserOverride", "input":"t","out":true},"label":"browser URI can override t (defined in asset)"}, - {"fn":"url","data":"http://foo.com?foo=1#t=1,100,400,500*1.2,2.3", "expect":{ "fn":"equal.mediafragmentT", "input":"3","out":"500"},"label":"a equal.mediafragment"}, - {"fn":"url","data":"http://foo.com?foo=1#t=1,100,400,500*1.2,2.3", "expect":{ "fn":"equal.mediafragmentTSpd", "input":"1","out":"2.3"},"label":"a equal.mediafragmentSpeed"} + {"fn":"url","data":"http://foo.com?foo=1#t=1,100,400,500*1.2,2.3", "expect":{ "fn":"equal.mediafragmentT", "input":"3","out":"500"},"label":"a equal.mediafragment"} ] diff --git a/src/spec/xywh.json b/src/spec/xywh.json index 8097c15..203a3b5 100644 --- a/src/spec/xywh.json +++ b/src/spec/xywh.json @@ -1,5 +1,4 @@ [ {"fn":"url","data":"http://foo.com?foo=1#xywh=0,0,1,1", "expect":{ "fn":"equal.mediafragmentXYWH", "input":"2","out":"1"},"label":"xywh"}, - {"fn":"url","data":"http://foo.com?foo=1#xywh=1,100,400,500*1.2,2.3", "expect":{ "fn":"equal.mediafragmentXYWH", "input":"3","out":"500"},"label":"a equal.mediafragment"}, - {"fn":"url","data":"http://foo.com?foo=1#xywh=1,100,400,500*1.2,2.3", "expect":{ "fn":"equal.mediafragmentXYWHSpd", "input":"1","out":"2.3"},"label":"a equal.mediafragmentSpeed"} + {"fn":"url","data":"http://foo.com?foo=1#xywh=1,100,400,500", "expect":{ "fn":"equal.mediafragmentXYWH", "input":"3","out":"500"},"label":"a equal.mediafragment"} ] diff --git a/src/xrfragment/XRF.hx b/src/xrfragment/XRF.hx index f249481..cea5276 100644 --- a/src/xrfragment/XRF.hx +++ b/src/xrfragment/XRF.hx @@ -118,16 +118,6 @@ class XRF { v.int = Std.parseInt(str); v.x = cast(v.int); } - if( isMediaFrag.match(str) ){ - var speed:Array = str.split("*"); - v.speed = new Array(); - if( speed.length > 1 ){ - var values:Array = speed[1].split(","); - for( i in 0...values.length ){ - v.speed.push( Std.parseFloat(values[i]) ); - } - } - } v.filter = new Filter(v.fragment+"="+v.string); }else v.filter = new Filter(v.fragment); }