immersive-web / model-element

Repository for the <model> tag. Feature leads: Marcos Cáceres and Laszlo Gombos
https://immersive-web.github.io/model-element/
Other
66 stars 12 forks source link

Supply an Image-based Light file #71

Open zachernuk opened 1 year ago

zachernuk commented 1 year ago

At TPAC we agreed that specifying an image-based light (IBL) is an important component of a V1 implementation and specification. In addition to the specific name (environment map, lighting environment, IBL etc), there is the matter of structural representation, i.e. how it resides within the tree structure of the <model> markup itself.

I don't have a strong opinion but some candidates I can see are:

  1. An attribute on the <model> tag:
    <model environment-map="warehouse.hdr">
    <source src="shelf.usdz"/>
    </model>
  2. An attribute on the <source> tag
    <model>
    <source src="shelf.usdz" environment-map="warehouse.hdr"  />
    </model>
  3. An independent tag inside the <model> block
    <model>
    <environment-map src="warehouse.hdr" />
    <source src="shelf.usdz"/>
    </model>

    Or some more complex nesting of <source> elements within such a tag. It should be simple, but my expectation is that the role and complexity of <model> will increase over time, so something expressive enough to meet some obvious needs would be useful.

zachernuk commented 1 year ago

/agenda

mrdoob commented 1 year ago

Sharing this new HDR file format for awareness: https://developer.android.com/guide/topics/media/platform/hdr-image-format

cabanier commented 1 year ago

I don't remember that we agreed that version 1 needs this. If we add it, my vote is for option 1.

zachernuk commented 7 months ago

In #72, after finding value in the addition of a JS object for a model's root element, as well as looking forward to a future where a scene graph is appealing, I'm also leaning toward using that rootElement node to specify an IBL as well, among other capabilities.

The main benefit being that many web authors may want to override the IBL on subsets of the scene graph - e.g. a different environment map on the polished stainless steel to the lights affecting the brushed aluminum casing of a high-end desktop computer.

/facetoface

zachernuk commented 1 month ago

/tpac

zachernuk commented 1 week ago

/agenda Somehow I failed to imagine also using CSS to specify this. I quite like the idea, particularly because it means that it can be changed around with CSS classes that might indicate color themes etc, and possibly to let things like transition-duration impact the cross-fading between different environment maps.

One question would be if / how that alters an expected event model for the loadedness of the asset. Is there a right way to manage that in 2024 (and beyond?)

mrdoob commented 1 week ago

There's a new GPU-optimized HDR format now: https://github.com/BinomialLLC/basis_universal/wiki/todo