Skip to content

Remove UV warning when setting textures with setUniform() #5512

Closed
@aferriss

Description

@aferriss

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:

If you are using the vertex function and supplying your own UV's, when using the setUniform() function to send a texture to a custom shader, a warning is triggered telling you: "You must first call texture() before using vertex() with image based u and v coordinates ".

Since we're supplying the texture with setUniform(), we shouldn't be showing this warning.

Actually, I think there is a case to be made to remove this warning entirely. It could be that the user is writing a procedural shader, and not using textures, in which case, the warning isn't necessary at all.

The warning seems to go away when using textureMode(NORMAL);

  • p5.js version: 1.4
  • Web browser and version: Chrome 96
  • Operating System: Mac OSX
  • Steps to reproduce this:
  1. Load a custom shader that samples a texture
  2. Send the texture to the shader
  3. Draw some geometry with beginShape(), vertex() ....
  4. Observe the warning.

Here's a small example showing the issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    DONE! 🎉

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions