Skip to content

Implement ASCIIEffect #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
Tracked by #600
vanruesc opened this issue Feb 17, 2025 · 6 comments
Closed
4 tasks done
Tracked by #600

Implement ASCIIEffect #685

vanruesc opened this issue Feb 17, 2025 · 6 comments
Assignees
Milestone

Comments

@vanruesc
Copy link
Member

vanruesc commented Feb 17, 2025

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.
@LucaArgentieri
Copy link
Contributor

LucaArgentieri commented Feb 17, 2025

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?

@vanruesc
Copy link
Member Author

Do I have to wait

No, you can go ahead 👌

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

@LucaArgentieri
Copy link
Contributor

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

@vanruesc
Copy link
Member Author

vanruesc commented Feb 18, 2025

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 👍

LucaArgentieri added a commit to LucaArgentieri/postprocessing that referenced this issue Feb 19, 2025
@LucaArgentieri
Copy link
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

vanruesc pushed a commit that referenced this issue Feb 27, 2025
* created ASCIIEffect | created ASCIITexture | created demo

* fix some types in ascii files

* refactor ascii effect

* Created ASCIITexture | Created ASCIIEffect | Created ascii demo in manual | Added unit test | #685

* fixed formatting, typos, errors and commented ASCIIEffect test

* refactor ASCII demo settings and improve ASCIITexture constructor formatting

* refactor ASCII demo rendering loop for improved readability
vanruesc added a commit that referenced this issue Mar 2, 2025
@vanruesc vanruesc closed this as completed Mar 2, 2025
@vanruesc
Copy link
Member Author

vanruesc commented Mar 2, 2025

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants