immersive-web / immersive-web/model-element

Environment maps: Add cubemap support alongside equirectangular images

Open
#143 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
86
Forks
12
Avg merge
7h 12m
Merged PRs (30d)
1

Description

In the explainer, it indicates the environment map is specified as an equirectangular image.

However GPUs are better suited at processing cube maps. They exhibit less artifacts around the poles and a UA may prefer or automatically convert an equirectangular image to a cubemap.

There are a few ways we could add cubemap support.

One is automatically, if the image is a file which supports layers and contains 6 layers, the image is automatically imported as a cubemap. Popular cubemap formats include ktx, exr, and dds amongst others.

Another option is specifying the cube faces directly as 6 different files. I.e., instead of:

environmentmap="envmap.hdr"

one could provide the maps for the 6 faces:

environmentmap-plus-x="envmap-x1.hdr"
environmentmap-minus-x="envmap-x2.hdr"
environmentmap-plus-y="envmap-y1.hdr"
environmentmap-minus-y="envmap-y2.hdr"
environmentmap-plus-z="envmap-z1.hdr"
environmentmap-minus-z="envmap-z2.hdr"

or alternatively we could support a comma separated list instead:

environmentmap="envmap-x1.hdr, envmap-x2.hdr, envmap-y1.hdr, envmap-y2.hdr, envmap-z1.hdr, envmap-z2.hdr"

These are just a few ideas, perhaps there are other better ones as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DOM API section of explainer.md and compare its current equirectangular environment-map definition with the cubemap approaches described here. The first step is to resolve which representation and file formats the API should support; done means one approach is agreed and the explainer specifies its syntax and behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.