From 01a481414983f1add0ce4a4feef3982789b18349 Mon Sep 17 00:00:00 2001 From: Leon van Kammen Date: Fri, 2 Feb 2024 13:51:50 +0000 Subject: [PATCH] added l: and uv: primitive to mediafragments --- doc/RFC_XR_Fragments.html | 75 ++++++--- doc/RFC_XR_Fragments.md | 39 ++--- doc/RFC_XR_Fragments.txt | 312 ++++++++++++++++++++++---------------- doc/RFC_XR_Fragments.xml | 75 ++++++--- doc/RFC_XR_Macros.txt | 18 +-- example/assets/index.glb | Bin 6661472 -> 6661932 bytes src/Test.hx | 13 +- src/spec/speed.json | 3 + src/spec/t.json | 3 +- src/spec/xywh.json | 3 +- src/xrfragment/XRF.hx | 10 -- 11 files changed, 335 insertions(+), 216 deletions(-) create mode 100644 src/spec/speed.json 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 e1d857ddff0e37ed266f7100a9c6e103be55ef84..e3dc0a9b7d20e315181ac935adb6e029dc7e7d27 100644 GIT binary patch delta 9837 zcmcIp3wTu3wO(`1B)kG7lSv2|AS8%9X2N;R%$bmxlVEs15}qmqOoSj>9^r9Ot2WSH zA8qNwqSbgmw1NrL+sDPK=x43A-Zt2;)qb`Vzv`8$)cdb>&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%}{HIG#mA=*g+4y(B zx6E02@Qb~h;{2WQ4M*u9e_!0Z@&JFYUt1b!9%_Bd!ddZ}={pa+dHYUJR9pF1G(PDuPPFp?*_4T_i|z6z(iVo+qA_~;HbPvj4V zh~65$OpZ=_79IZDCQ51w*zSwnus5*|nF{>Gl zskg<)Z&`qER9$hjjK9-UPWSkeDH5+P=-lJrm3YeQYrHqEd*8cSJNuK=c+PVTUX!+} z=?CxKgVo;eZvXD8?U`6weDbUxy{olb3vc(1-}IXIbM5>{M!erERfjzvIqZG$%&p$q zW&iUJ?fmr_ac#=C-qqSK>+kihHIm{@+v8jA@jmRM#;?}iQ@hq%S>;e%B51dLxW=1& z@GsuK+TK5RwU_^&{ido`0PbE5Y3f6T^eh>q({HQDrYP;A z7&-Jj#mS@HR7z#^9QCIG^cxyV!{`|rK_lrYDyItCNuy~D?Vw3?BWP;5)C71fq zKpIS=Xe>>nso35dXe_fKB}h|pzwX5>hYU}b|39UZx#-rj$TIZ%Ty=wZiw8quEXdE zAOnyI$O2>o+5&O_?Eu#R+5)c)2b2QJ0Q~^{0RsR70fPX80Yd;o z0mA^p0V4n-0oMaY0m=atfYE?4fU$rZ0OJ7T0TTcd0h0hX0wx2d0Hy+_0V)C00W$zI O0ki5mjGmo#!~X&HKBvq8 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); }