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

feat(core): add option to use WebGPURenderer #787

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kekkorider
Copy link

@kekkorider kekkorider commented Jul 20, 2024

This feature adds a webGPU parameter to TresCanvas which determines what renderer to use, whether the WebGLRenderer or WebGPURenderer, allowing people to use new techs like TSL.

At the moment this feature is broken as soon as I import the WebGPURenderer, it returns the following error:

✘ [ERROR] Top-level await is not available in the configured target environment ("chrome87", "edge88", "es2020", "firefox78", "safari14" + 2 overrides)

    ../node_modules/.pnpm/[email protected]/node_modules/three/examples/jsm/capabilities/WebGPU.js:14:15:
      14 │   isAvailable = await navigator.gpu.requestAdapter();

The error can be seen by uncommenting this line.

I tried fixing it with the vite-plugin-top-level-await plugin but unfortunately no luck,

I assume there's some configuration somewhere I'm not aware of that I should override.

Copy link

netlify bot commented Jul 20, 2024

Deploy Preview for tresjs-docs ready!

Name Link
🔨 Latest commit dba3cd3
🔍 Latest deploy log https://app.netlify.com/sites/tresjs-docs/deploys/66c5ce997a1d0300080483c2
😎 Deploy Preview https://deploy-preview-787--tresjs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kekkorider kekkorider changed the title Add option to use WebGPURenderer feat(core): add option to use WebGPURenderer Jul 20, 2024
@alvarosabu
Copy link
Member

cc @andretchen0

@kekkorider kekkorider force-pushed the feat/webgpu-renderer branch from 444ceac to 3855bd2 Compare August 21, 2024 10:50
Copy link

pkg-pr-new bot commented Aug 21, 2024

commit: dba3cd3

pnpm add https://pkg.pr.new/@tresjs/core@787

Open in Stackblitz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants