mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.06k stars 35.41k forks source link

Add support for space warp in WebXR #24581

Open cabanier opened 2 years ago

cabanier commented 2 years ago

The Oculus browser is in the process of adding support for Space Warp. TLDR , this is a technology that allows an experience to render at half the frame rate but display at the full display frame rate.

To make this work, the site needs to submit a low resolution motion vector texture and a low resolution depth texture in addition to the regular color texture.

How hard would it be add support for this to three.js?

mrdoob commented 2 years ago

Hmm... What's needed for generating that motion vector frame? 🤔

cabanier commented 2 years ago

Basically, instead of drawing a color or sampling from a texture, the geometry needs to be filled with a delta pose

mrdoob commented 2 years ago

Per-pixel deltas? That seems hard when you include skinning, morph targets, displacement and normal naps... 🤔

donmccurdy commented 2 years ago

Related:

/cc @bhouston

cabanier commented 2 years ago

Per-pixel deltas? That seems hard when you include skinning, morph targets, displacement and normal naps... 🤔

I was told that it usually isn't that hard to create a velocity map. Many recent games would not be possible before this feature was introduced and performance is the biggest issue in WebXR. Maybe it won't work for everything. If so, we could add warnings to three and enhance the browser API so the feature can be turned off.

mrdoob commented 2 years ago

Many recent games would not be possible before this feature was introduced and performance is the biggest issue in WebXR.

What are some of those games? I would like to check them out on a Quest 2 to see how they look.

cabanier commented 2 years ago

What are some of those games? I would like to check them out on a Quest 2 to see how they look.

I will ask if I can share that publicly

Edit: a quick search showed this article, this one, this one and this one