Skip to content

createFilterShader throws an error in 2D mode #6520

@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
  • Internalization
  • Friendly Errors
  • Other (specify if possible)

p5.js version

1.8.0

Web browser and version

Firefox 117

Operating System

macOS 14

Steps to reproduce this

Steps:

  1. Create a sketch in 2D mode
  2. Create a filter shader with createFilterShader

You get an error about only being able to do this in WebGL mode.

This is because initially, we were thinking of letting createFilterShader be a way to make custom shaders that can be used in general, not just in filter. However, since #6482, we auto-bind these to the filter graphic anyway.

I propose that we:

  1. take out this error so that even 2D users can use custom filter shaders that people make
  2. add a separate method (createCustomFragmentShader?) to create a normal shader using a default vertex shader

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