Skip to content

[css-spatial] Depth limits the person sets, plain depth words, and stereo images #163

Open

Description

@danielcamposramos

I build Sparky Stereo OS, a Linux desktop where windows, menus and theme elements already sit at real depth on 3D TVs and projectors, VR headsets, glasses-free 3D displays and any monitor with red-cyan glasses, while a plain 2D monitor shows the same desktop without any change.
Each element is drawn once per eye and shifted by its own depth, and each display receives the same two views in its own format.
Its architecture is described in Architectural synthesis of Sparky Stereo OS.
Three things from that work may help this draft.

1. The limits are the person's, set once for the whole system

The draft says the UA chooses "a comfortable front limit for the user", "in consideration of the window context, user preferences, etc."
On our desktop the limits are an operating system setting: the person sets them once in System Settings, and every window and menu follows them, starting from our measured defaults of popped up to 4 px and sunk down to 10 px of disparity on a screen 1920 pixels wide.
A browser can read them there, as it already reads the person's colour scheme and reduced motion from the system, so a page keeps the same comfort as everything else on that screen.
Comfort differs between people and between displays, a 3D TV across the room, a monitor at arm's length, a glasses-free display, a headset, so the person's own value should win over the UA's default.
We also found that the back needs the larger range.
Content in front of the screen that touches its edge breaks the picture, while content behind it reads like a view through a window.
The planes and the limits are described in Declared planes and user limits.

Suggestions: say that the front limit comes from the person's system setting where one exists, and consider a back limit for spatial: page as well.

2. Centimetres for cameras, pixels for pages

Centimetres are the right unit for a camera: a portal's 3D scene and <model> content.
Pixels are the right unit for a page: on a screen, depth is disparity, the horizontal shift between the left and right views, counted in pixels.
For elements on the page, the comfortable range depends on the display and on the person, so an author cannot know how much depth to ask for in either unit.
Our desktop, its themes and our SVG draft use three words and a fraction:

sunk | screen | popped | <percentage> | <number>

popped is the person's front limit, sunk their back limit, screen the page plane, and a percentage or number is a fraction of the limit on its side, which the reader turns into pixels of disparity for each display.
The draft already resolves inset-front percentages "relative to the distance from the containing block to the front limit plane", so popped is inset-front: 100% today.
Keywords would let an author say what they mean, and the same declaration would hold on every display and for every person's limits.

Suggestion: sunk, screen and popped as keywords of the z-axis insets.

3. Stereo images in a spatial page

The explainer begins: "Today, web content is flat, even on devices with stereoscopic displays."
A stereo image inside a spatial page is flat too, even when its file declares the pair: MPO and JPS photos, video whose container declares its layout (Matroska's StereoMode, the MP4 StereoVideoBox), PNG's sTER chunk.
SVG had no such mark, so we proposed SVGStereo at the WICG (WICG/proposals#316): one attribute saying that a drawing holds two complete views side by side, left eye first, and a separate part for single-view drawings with depth in the three words above (DEPTH.md).

Suggestion: say how a UA presents an image that declares a stereo pair inside a spatial context, each view to its own eye, at the plane of the image's box.

Earlier work that may help

  • 1994: Dave Raggett's proposal for platform independent virtual reality on the Web, which named VRML at the first WWW conference.
  • 2011: the Declarative 3D for the Web Architecture Community Group, from X3DOM and XML3D.
  • 2012: the Stereoscopic 3D Web Task Force of the Web and TV Interest Group, whose draft proposed CSS properties for "a web-based (HTML and CSS) user interface that is rendered in stereoscopic 3D on a 3D display", a 3d-display media type, and graceful degradation to 2D.
  • 2013: the Stereoscopic 3D Web Community Group, with the Universitat Autònoma de Barcelona's studies of how people perceive stereoscopic web pages.

The PM-KR Community Group's report records the 2012 and 2013 work with its sources: Stereo 3D on Linux and the Web, "Twice at W3C".

This was written with AI partners; I checked it and sign it.

Related

Spec: https://webkit.github.io/explainers/css-spatial/

Activity

  1. danielcamposramos commented on Nov 6, 2026

    @danielcamposramos
    Author

    A correction to this issue: it says popped is inset-front: 100% today, and that is backwards.
    In the draft, inset-back is measured from the page plane and moves a box toward the viewer (its own example raises text with inset-back: 1cm), and inset-front computes to the negative of inset-back.
    Percentages run to the front limit plane, so popped is inset-back: 100%.
    Could the editors confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions