Skip to content

Show error message when applying shader to different GL context #2895

@aferriss

Description

@aferriss

Nature of issue?

Using the same shader more than once causes either nothing or an odd looking tessellated plane to be rendered on the screen. I made an alpha editor sketch to show the issue.

The use case I'm imagining for using the same shader more than once is when you want to do some kind of multi-pass effect like a gaussian blur. It would be great to just write one shader that you could pass a direction uniform to, rather than have two separate shaders with almost exactly the same code.

A simple workaround is just to make two shader variables with the same shader source. WebGL doesn't spit out any errors as far as I can tell. Though it does say something whever I use createCapture with a shader and a createGraphics layer. Error: WebGL warning: drawElements: Active texture 0 for target 0x0de1 is 'incomplete', and will be rendered as RGBA(0,0,0,1), as per the GLES 2.0.24 $3.8.2: The dimensions of level_base are not all positive.

  • Found a bug
  • Existing feature enhancement
  • New feature request

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop
  • Others (specify if possible)

Details about the bug:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! 🎉

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions