Skip to content

buildGeometry doesn't work with point() ? #7838

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

Open
1 of 17 tasks
ffd8 opened this issue May 22, 2025 · 1 comment
Open
1 of 17 tasks

buildGeometry doesn't work with point() ? #7838

ffd8 opened this issue May 22, 2025 · 1 comment

Comments

@ffd8
Copy link
Contributor

ffd8 commented May 22, 2025

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)

p5.js version

1.11.7

Web browser and version

Chrome 136.0.7103.93

Operating system

MacOS

Steps to reproduce this

Steps:

  1. Try creating a custom buildGeometry() shape using points
  2. They appear for 1 frame (if using clear() or background() then go poof
  3. Not an issue if rendering line() or sphere()

Snippet:

See example here.

FYI, was exploring buildGeometry() for a faster point cloud when drawing the obj.computeFaces().vertices as discussed here and wonder if it's intentional or a bug that point() doesn't work?

@davepagurek
Copy link
Contributor

This one is intentional for now -- buildGeometry generates a thing that you can draw in one go, but fundamentally points are drawn with a different shader than regular meshes, so for now that means p5.Geometry is for meshes only. (Similarly, switching shaders inside buildGeometry won't save either for the same reason.)

I think if we want to support this, we might need to try merging points and strokes so that points can be stored alongside the other strokes on a p5.Geometry. We currently use a separate shader for points, and there are some aspects of strokes that currently would break if used for points (I think we assume that all strokes have >= 2 points when we convert strokes to meshes) so we'll need to update a few spots there too. If any contributors are interested in looking into how that might be done, let me know!

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

No branches or pull requests

2 participants