Skip to content

Draft spec - #19

Open
m-alkalbani wants to merge 15 commits into
mainfrom
marker-tracking-draft-spec
Open

m-alkalbani wants to merge 15 commits into
mainfrom
marker-tracking-draft-spec

Conversation

@m-alkalbani

@m-alkalbani m-alkalbani commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

First attempt at the marker-tracking spec (draft)

First draft of marker-tracking spec
@m-alkalbani

Copy link
Copy Markdown
Contributor Author

@himorin can we set up the action to build the HTML for gh pages please?

@m-alkalbani

Copy link
Copy Markdown
Contributor Author

I am aware folks are away for a while currently, so adding @toji for info

@himorin

himorin commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

before setting up GHAction (basically you can include copy of .github/workflows/auto-publish.yml from some other repository - without echidna specific config), you need to fix group and status.
it's totally up to CG co-chairs (no W3C staff assigned to any CG as contact), but there is immersivewebwg in bikeshed boilerplate, but no immersivewebcg. Once CG co-chairs defines/decides way to go (e.g. having CG/UD template in immersivewebwg, or new immersivewebcg), I of course could help on modification.

also you may want to have .pr-preview.json.

See PR #20

@m-alkalbani

m-alkalbani commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor Author

/agenda heads up on spec draft and issues in #3

@toji toji left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of comments from my first pass through the doc, though a fair amount of it can be chalked up to normalizing bikeshed use with the other immersive web specs. Really encouraging first draft! Thanks!

Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
Comment thread index.bs Outdated
</pre>

The `XRMarkerTrackingState` values correspond to the [=marker tracking state=] values defined in the [[#marker-tracking-discovery-model|Discovery Model]].
The `"untracked"` value is used by the algorithms in this module, but marker-tracking results only include markers whose tracking state is `"tracked"` or `"emulated"`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is interesting. I feel like I've seen at least one other instance in a web spec of an enum value that was only used by internal algorithms, but I don't recall where. (Might be in WebXR, in which case I'm embarrassed in advance that I don't recall my own writing.)

In any case, it feels like it could cause some developers confusion because the presence of the state in the enum may make them think they have to check for it.

Perhaps the better question is: What do we expect developers to do with the differences between "tracked" and "emulated" markers? If we don't have a compelling use case for exposing the value then it may be best to leave this state entirely internal. Also, could the existing emulatedPosition boolean of an XRPose be used instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great points thanks! I may be wrong here, but I looked a little more into emulatedPosition and to my understanding it describes whether an XRPose between two XRSpace objects relies on an emulated position, not whether a particular marker is (or is not) currently being tracked/observed. So an emulatedPosition can become true for reasons unrelated to marker visibility (?).

I looked into AndroidXR's way of doing this and it seems to treat marker observation/tracking independent of pose emulation, so it still feels to me that this approach would be useful to describe whether the physical marker is currently being observed or not, rather than whether a particular XRSpace pose relies on emulation.

I made a few changes here based on my (potentially wrong) understanding: removed "untracked" from XRMarkerTrackingState as it doesn't need to be exposed, expanded "tracked" and "emulated" descriptions/justification and developer guidance around them and added a small note to distinguish between emulatedPosition and the current approach.

All this being said, this is definitely worth discussing again! (#10).

Changes: 8cac5d7

Comment thread index.bs
readonly attribute XRMarkerTrackingState trackingState;
readonly attribute DOMString? payloadString;
readonly attribute XRMarkerExtent? extent;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking through the rest of the text it's not clear how developers are intended to correlate markers from frame to frame. We have some values, such as Anchors, where the spec takes care to specify that the JavaScript object returned will be the same each frame, so developers can use the object for equality checks or as a map key. That approach also leaves a "live" object in the developers hands, though, which can be tricky in some circumstances.

If that's not a guarantee we want to provide then the marker identifier should be exposed here. (If it's not exposed then I'm not completely clear on what the purpose of the identifier is?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for flagging this, I reworked this slightly following the discussion in the group by introducing an XRMarker object so results for the same marker across frames will reference the same object (IDLs have been updated accordingly). The marker identifier can remain unexposed and internal for now.

I am not entirely sure the marker identifier is (still) needed actually, but we can discuss this further (#5). Changes: 3ec6971

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to: 8cac5d7

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding anchors and whether they should be returned or exposed here, I mentioned this in #5 to discuss further (still thinking on it)

Comment thread index.bs
3. For each [=tracked marker=] |marker| in |session|'s [=list of tracked markers=]:
1. If |marker|'s [=marker tracking state=] is `"untracked"`, continue to the next entry.

2. Let |result| be a new `XRMarkerTrackingResult`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to the above concern: This explicitly says that the JS value won't be comparable frame-to-frame, so a separate identifier would be needed. That's not how WebXR has generally approached these types of concerns, though, so it's worth further discussion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should have done this in the previous PR (apologies!) - updated the algorithm for the new XRMarker object. A new XRMarkerTrackingResult is still being created for each frame but it now references the marker object. I am not entirely sure this is the right way to go so definitely worth further discussions (#5).

Changes: a3d7c65

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to: 8cac5d7

Comment thread index.bs Outdated

<section class="non-normative">
Marker tracking is not intended to provide frame-perfect object tracking. Applications SHOULD account for tracking-state changes, pose updates and possible discontinuities when attaching virtual content to a marker.
In particular, applications SHOULD avoid presenting emulated marker poses as though they were actively tracked poses for moving physical markers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This partially answers my question from earlier about how developers are supposed to use the emulated information (though it may still be possible to support it through XRPose.emulatedPosition) I'm still a little unclear on what this means in practice, though?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to: 8cac5d7 (do we still need a solid example here maybe?)

Comment thread index.bs
<a class="self-link" href="#set-up-marker-tracking-section"></a>
</h4>

In order to <dfn export>set up marker tracking</dfn> for a {{XRSystem/requestSession()}} session request, add the following steps to [=initialize the session=] for the new [=XRSession=] |session|:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect that marker tracking will have non-trivial computational overhead. Do we need a way to turn it on and off over the course of the session? Do the underlying native capabilities support that?

I know that we've had similar conversations for other features, but browsing through similar tracking specs I'm not seeing start/stop methods, so perhaps it's a non-issue. Worth at least discussing, though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great point. I am leaning more towards providing a way to turn it on and off as that feels like the right thing to do from a web sustainability/performance point of view, and that would also be consistent with other modules in WebXR. It would also cover more use cases (i.e. some experiences may only need marker tracking briefly, while others may need continuous tracking or want to re-enable it later). Opened #21

Comment thread index.bs Outdated
Co-authored-by: Matthew Tylee Atkinson <matatk@users.noreply.github.com>
Comment thread index.bs Outdated
Comment thread index.bs Outdated
m-alkalbani and others added 3 commits September 22, 2026 10:21
Co-authored-by: Matthew Tylee Atkinson <matatk@users.noreply.github.com>
Co-authored-by: Matthew Tylee Atkinson <matatk@users.noreply.github.com>
@m-alkalbani

Copy link
Copy Markdown
Contributor Author

@himorin the pr-preview still doesn't seem to work, I tried adding it manually to the first comment but that didn't work either. Can you help when you have the chance please?

@m-alkalbani

Copy link
Copy Markdown
Contributor Author

/tpac

@probot-label probot-label Bot added the TPAC label Sep 23, 2026
@himorin

himorin commented Sep 23, 2026

Copy link
Copy Markdown
Member

@himorin the pr-preview still doesn't seem to work, I tried adding it manually to the first comment but that didn't work either. Can you help when you have the chance please?

check thread of https://lists.w3.org/Archives/Public/spec-prod/2026JulSep/0006.html

@himorin

himorin commented Sep 24, 2026

Copy link
Copy Markdown
Member

For validation error, consider switching <section class="non-normative"> part into 1) moving all into html including markdown heading part , or 2) having some other element to wrap them.

@m-alkalbani

Copy link
Copy Markdown
Contributor Author

/agenda

@probot-label probot-label Bot added the agenda label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants