Skip to content

Conversation

@sunag
Copy link
Collaborator

@sunag sunag commented Jul 26, 2025

Description

Alternative to textureLoad().
Equivalent to what we use with texture().sample(), now with texture().load().

@sunag sunag added this to the r179 milestone Jul 26, 2025
@sunag sunag marked this pull request as ready for review July 26, 2025 04:18
@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 338.37
78.9
338.37
78.9
+0 B
+0 B
WebGPU 561.84
155.42
561.89
155.44
+45 B
+13 B
WebGPU Nodes 560.45
155.18
560.49
155.19
+45 B
+13 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 469.75
113.6
469.75
113.6
+0 B
+0 B
WebGPU 636.57
172.28
636.62
172.29
+45 B
+16 B
WebGPU Nodes 591.22
161.5
591.26
161.52
+45 B
+16 B

@sunag sunag merged commit 297579c into mrdoob:dev Jul 26, 2025
9 checks passed
@sunag sunag deleted the dev-texture-load branch July 26, 2025 04:37
@mrdoob
Copy link
Owner

mrdoob commented Jul 31, 2025

How about sampleNearest() instead?

@sunag
Copy link
Collaborator Author

sunag commented Jul 31, 2025

How about sampleNearest() instead?

I'm not sure yet if it's the best name, the function is closer to textureLoad(), as it doesn't use sampling, it's uv[x][0-width](u32) instead of uv[x][0-1](f32).

Edit: Maybe pixel() or get() 🤔...

@mrdoob
Copy link
Owner

mrdoob commented Jul 31, 2025

read(), readTexel(), fetch(), fetchTexel(), ... ?

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.

2 participants