Skip to content

[p5.js 2.0 Bug Report]: [p5.strands] noise() with vector args stopped working #8226

@davepagurek

Description

@davepagurek

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

2.1 RC

Web browser and version

Any

Operating system

Any

Steps to reproduce this

Steps:

  1. Create a p5.strands shader
  2. Inside of it, use noise() with a single vector argument
  3. Use the shader

In 2.0.5, this worked, but in the 2.1 RC, this throws an error: "Darn! An error occurred compiling the fragment shader:ERROR: 0:433: 'constructor' : not enough data provided for construction"

Snippet:

function setup() {
  createCanvas(400, 400, WEBGL);
  let sh = baseMaterialShader().modify(() => {
    getFinalColor(() => {
      return [noise([0, 1]), 0, 0, 1]
    })
  })
  
  shader(sh)
  plane(width, height)
}

Live: https://editor.p5js.org/davepagurek/sketches/H78YBMPtL

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions