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

WebGPURenderer: copyFrameBufferTexture() rectangle parameter added #29384

Merged
merged 2 commits into from
Sep 17, 2024

Conversation

aardgoose
Copy link
Contributor

WebGPURenderer.copyFramebufferToTexture() lacks the position parameter.
(used in LensFlare and the webgl_framebuffer_texture example.

Questions:

  1. Which coordinate system should be used (0,0) as top left (WebGPU) or bottom left (WebGL)?

  2. Should attempts to copy from areas outside the framebuffer cause errors? WebGPU fails with console warnings, WebGL ignores and returns 0 for those areas.

Copy link

github-actions bot commented Sep 10, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 685.83
169.75
685.83
169.75
+0 B
+0 B
WebGPU 832.14
222.98
832.68
223.13
+539 B
+146 B
WebGPU Nodes 831.65
222.86
832.19
223
+539 B
+144 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 462.42
111.53
462.42
111.53
+0 B
+0 B
WebGPU 529.9
142.75
530.44
142.9
+539 B
+153 B
WebGPU Nodes 486.56
132.61
487.1
132.77
+539 B
+154 B

@sunag
Copy link
Collaborator

sunag commented Sep 11, 2024

  1. WebGPU top-left.
  2. console warnings is good

I think it should be a rectangle instead of just position.

@aardgoose
Copy link
Contributor Author

aardgoose commented Sep 12, 2024

By rectangle do you expect (x,y width, height) or (x1 y1, x2, y2)?

@aardgoose aardgoose changed the title RFC: WebGPURenderer.copyFrameBufferTexture() position parameter WebGPURenderer: copyFrameBufferTexture() rectangle parameter added Sep 13, 2024
@aardgoose aardgoose marked this pull request as ready for review September 13, 2024 11:01
@Mugen87 Mugen87 added this to the r169 milestone Sep 17, 2024
@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 17, 2024

I vote for (x,y width, height).

@aardgoose
Copy link
Contributor Author

I vote for (x,y width, height).

That is what I guessed, that is what is in place at the moment.

@sunag sunag merged commit ac73c49 into mrdoob:dev Sep 17, 2024
12 checks passed
@aardgoose aardgoose deleted the cftt branch September 18, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants