Skip to content

Implement ASCIIEffect #685

Closed
Closed

Description

@vanruesc

Description

Related: #683, #684

Implement an ASCIIEffect.

Tasks

  • Create ASCIITexture.
  • Create ASCIIEffect.
  • Create ascii demo under special-effects.
  • Add unit test.

Implementation Details

  • The implementation from v6 can be ported mostly as-is.

Activity

  1. added this to the v7 milestone on Feb 17, 2025
  2. LucaArgentieri commented on Feb 17, 2025

    @LucaArgentieri
    Contributor

    I’m working on it!

    Do I have to wait for the effect in the package to be published before creating the demo/unit test?

  3. vanruesc commented on Feb 17, 2025

    @vanruesc
    MemberAuthor

    Do I have to wait

    No, you can go ahead 👌

    FYI: there are some relevant notes in #600 for the PR workflow.

  4. LucaArgentieri commented on Feb 18, 2025

    @LucaArgentieri
    Contributor

    @vanruesc How can I test the effect if I cannot import it in the demo?
    Forgive me if I ask for banalities 🙇‍♂️

  5. vanruesc commented on Feb 18, 2025

    @vanruesc
    MemberAuthor

    I'm not sure I understand the question 🤔

    My approach would be like this:

    1. Check out the v7 branch.
    2. Create ASCIITexture in src/textures and ASCIIEffect in src/effects (using the v6 implementation as reference).
    3. Update the index.js files in those folders to re-export the new classes.
    4. Create ascii.js in manual/assets/js/src/demos/ (copying an existing demo such as color-depth).
    5. Create a new manual demo page ascii.en.md in manual/content/demos/special-effects/.
    6. Use npm run watch to build and run the manual locally.
    7. ???
    8. profit

    It's also a good idea to run npm test before creating a PR to auto-fix formatting issues.

    If anything is unclear feel free to ask 👍

  6. LucaArgentieri commented on Feb 19, 2025

    @LucaArgentieri
    Contributor

    Hi @vanruesc,
    I got this error:

    • Could not find a valid mainImage or mainUv function (ASCIIEffect) , something seems to be broken in the ascii.frag

    This test fail:

    • ✘ [fail]: effects › ASCIIEffect › can be created and destroyed Error thrown in test
      
      ReferenceError {
        message: 'document is not defined',
      }
      
      

    I also commented setSize because I can’t access this.resolution and don’t know if this function is useful.

    Is it better for you to review the PR so that you understand the errors?

    I hope I didn’t create problems and complicated the task

  7. vanruesc commented on Mar 2, 2025

    @vanruesc
    MemberAuthor

    FYI: I've updated the demos to make them look a bit more interesting.

    You can get some pretty cool visuals when blending the ASCII effect with the original image:

    Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions