Skip to content

Browser freeze when creating >65k vertices in draw() loop (no validation or warning) #8219

@Homaid

Description

@Homaid

Most appropriate sub-area of p5.js?

  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • p5.strands
  • WebGL
  • DevOps, Build process, Unit testing
  • Internationalization (i18n)
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.11.10 (also tested on 2.0.5,issue exists in all versions)

Web browser and version

all browser

Operating system

windows 11

Steps to reproduce this

Steps:

  1. Paste the code below into the p5.js web editor (editor.p5js.org)
  2. Click "Play"
  3. Wait 1-2 seconds

Snippet:

function setup() {
  createCanvas(400, 400, WEBGL);
}

function draw() {
  background(200);
  beginShape();
  
  // Creating 100,000 vertices (exceeds 65k limit)
  for (let i = 0; i < 100000; i++) {
    vertex(random(-200, 200), random(-200, 200), random(-200, 200));
  }
  
  endShape();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions