Skip to content

p5shader - beginShape(POINTS | LINES) ignores custom shaders #5129

Open
@p5kontur

Description

@p5kontur

Most appropriate sub-area of p5.js?

  • Accessibility (Web Accessibility)
  • Build tools and processes
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Friendly error system
  • Image
  • IO (Input/Output)
  • Localization
  • Math
  • Unit Testing
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

  • p5.js version: 1.2.0
  • Web browser and version: Chrome 89.0.4389.90
  • Operating System: Windows 10 Home Premium
  • Steps to reproduce this: Vertices defined between beginShape(arg) and endShape() with arg = LINES | POINTS are not passed to custom shaders previously loaded and set with loadShader() and shader() functions.

`let theShader;
let mycube = null;
let activeCam;

function preload(){

theShader = loadShader('shader.vert', 'shader.frag');
}

function setup() {
createCanvas(600,600,WEBGL);
angleMode(DEGREES);
activeCam = _createCamera();
activeCam.apply();
mycube = _createCube();
}

function draw() {

shader(theShader);
activeCam.move();
scale(1,-1,1);
background(200)

theShader.setUniform('uSizeFactor', 10.0);
theShader.setUniform('uMorphFactor', math.abs(math.cos(millis() / 1000)));

//noFill();
//noStroke();
mycube.render(); // renders a cube with beginShape() / endShape()
}`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Features Don't Work in All Contexts

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions