p5jsShaderExamples | A collection of heavily commented WebGL shaders | Graphics library

 by   aferriss JavaScript Version: Current License: MIT

kandi X-RAY | p5jsShaderExamples Summary

kandi X-RAY | p5jsShaderExamples Summary

p5jsShaderExamples is a JavaScript library typically used in User Interface, Graphics, WebGL applications. p5jsShaderExamples has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A collection of heavily commented WebGL shaders created with p5.js and GLSL
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              p5jsShaderExamples has a low active ecosystem.
              It has 720 star(s) with 102 fork(s). There are 20 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 3 have been closed. On average issues are closed in 66 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of p5jsShaderExamples is current.

            kandi-Quality Quality

              p5jsShaderExamples has no bugs reported.

            kandi-Security Security

              p5jsShaderExamples has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              p5jsShaderExamples is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              p5jsShaderExamples releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of p5jsShaderExamples
            Get all kandi verified functions for this library.

            p5jsShaderExamples Key Features

            No Key Features are available at this moment for p5jsShaderExamples.

            p5jsShaderExamples Examples and Code Snippets

            No Code Snippets are available at this moment for p5jsShaderExamples.

            Community Discussions

            QUESTION

            Why my texture coordinates are inverted each time I call my glsl shader in p5js?
            Asked 2021-May-18 at 08:52

            I am trying to use a glsl shader with p5js to create a simulation like the game of life. To do that I want to create a shader which will take a texture as uniform and which will draw a new texture based on this previous texture. In a next iteration this new texture will be used as uniform and that should allow me create a simulation following the idea exposed here. I am experienced with p5.js but I'm completely new to shader programming so I'm probably missing something.

            For now my code is as straightforward as possible:

            • In the preload() function, I create a texture using the createImage() function and setup some pixels to be white and the others to be black.
            • In the setup() function I use this texture to run the shader a first time to create a new texture. I also set a timer to run the shader at regular intervals and draw the result in a buffer.
            • In the draw() function I draw the buffer in the canvas.
            • To keep things simple I keep the canvas and the texture the same size.

            My issue is that at some point the y coordinates in my code seems to get inverted and I don't understand why. My understanding is that my code should show a still image but each time I run the shader the image is inverted. Here is what I mean:

            I am not sure if my issue comes from how I use glsl or how I use p5 or a mix of both. Can someone explain to me where this weird y inversion comes from?

            Here is my minimal reproducible example (which is also in the p5 editor here):

            The sketch file:

            ...

            ANSWER

            Answered 2021-May-18 at 08:52

            Long story short: the texture coordinates for a rectangle or a plane drawn with p5.js are (0, 0) in the bottom left, and (1, 1) in the top right, where as the coordinate system for sampling values from a texture are (0, 0) in the top left and (1, 1) in the bottom right. You can verify this by commenting out your color sampling code in your fragment shader and using the following:

            Source https://stackoverflow.com/questions/67576655

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install p5jsShaderExamples

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/aferriss/p5jsShaderExamples.git

          • CLI

            gh repo clone aferriss/p5jsShaderExamples

          • sshUrl

            git@github.com:aferriss/p5jsShaderExamples.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link