Skip to content

[p5.strands] Instancing API improvements #8911

@aashu2006

Description

@aashu2006

Increasing access

This makes GPU instancing easier to discover and use without requiring a deep understanding of the underlying rendering pipeline. The goal is to make performant rendering techniques more approachable for artists, educators, students, and beginners.

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
  • p5.strands

Feature enhancement details

Summary

This issue tracks implementation work for improving the p5.strands instancing API as part of the Microgrant project.

Instancing is a powerful GPU technique for efficiently drawing large numbers of similar objects, but the current API can be difficult for newer users to discover and understand. This project builds on the existing rendering architecture to provide a more approachable and discoverable API surface.

Proposed Direction

let repeater = instances(100);
repeater.sphere(20);

// in a shader
let i = instanceIndex();

Planned Work

  • Add instanceIndex() as an alias for instanceID()
  • Implement instances(count) returning a drawable object
  • Integrate instancing with existing primitive rendering paths
  • Add tests for WebGL and WebGPU
  • Add documentation and examples

Project Context

This issue serves as a tracking thread for ongoing work and related pull requests for the p5.strands instancing API.

References

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions