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

raytracer: add support for per-point pointsize #29474

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

carli2
Copy link

@carli2 carli2 commented Sep 23, 2024

I created this patch to support pixel-perfect collision detection with individually sized points.

Here's an example vertex shader to use gl_Points with pointsize in world-coordinates:

      attribute float pointsize;
      uniform vec2 resolution;
      void main() {
         gl_Position = projectionMatrix * modelViewMatrix * vec4(position.x, position.y, position.z, 1.0);
         gl_PointSize = pointsize * resolution.y * projectionMatrix[1][1] / gl_Position.w;
      }

Copy link

github-actions bot commented Sep 23, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 687.32
170.19
687.52
170.25
+202 B
+55 B
WebGPU 836.34
224.18
836.54
224.24
+202 B
+55 B
WebGPU Nodes 835.85
224.06
836.05
224.12
+202 B
+59 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 463.24
111.86
463.24
111.86
+0 B
+0 B
WebGPU 532.75
143.69
532.75
143.69
+0 B
+0 B
WebGPU Nodes 489.1
133.44
489.1
133.44
+0 B
+0 B

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.

1 participant