Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGL & WebGPUDeviceContribution 支持 WebXR 配置项 #38

Closed
xiaoiver opened this issue Sep 26, 2023 · 1 comment
Closed

WebGL & WebGPUDeviceContribution 支持 WebXR 配置项 #38

xiaoiver opened this issue Sep 26, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@xiaoiver
Copy link
Contributor

xiaoiver commented Sep 26, 2023

参考:

在创建 WebGL 上下文时,传入 xrCompatible 配置项:

const gl = canvas.getContext("webgl", {xrCompatible: true});

在创建 WebGPU 时,传入 xrCompatible 配置项:

const gpuAdapter = await navigator.gpu.getAdapter({xrCompatible: true});
const gpuDevice = await gpuAdapter.requestDevice();
const xrGpuBinding = new XRGPUBinding(xrSession, gpuDevice);
const projectionLayer = xrGpuBinding.createProjectionLayer();

开发调试使用:https://blog.mozvr.com/webxr-viewer-2-0-released/

@xiaoiver xiaoiver self-assigned this Sep 26, 2023
@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: WebGL & WebGPUDeviceContribution supports WebXR configuration items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants