Giter Club home page Giter Club logo

Comments (5)

Rezmason avatar Rezmason commented on May 14, 2024 2

You know what? There are enough people who'd like this, that it's worth taking into serious consideration. Just gonna blue-sky brainstorm it.

So, first, there's some setup work to draw a texture containing an arbitrary string:

  1. extract the array of strings from the URL
  2. load Chicago.woff
  3. Wait till the font is loaded (FontFaceSet.check())
  4. Create a 2D canvas, style it with the loaded font and fallbacks, and render each unique character in the strings.
  5. Spoof an SDF by blurring them or something, this could look awful to be honest
  6. Assemble the texture

Then, the strings would need to be drawn in the grid somehow so that they're legible, but also look like they belong in the existing effect. The current rain pass uses mathematical functions to make waves of brightness roll down the cells in a column; the problem with this is, there is no actual relationship between any two cells, even if they're neighbors. They cycle their glyphs, but not in any way that guarantees any two characters appear next to one another, let alone for long enough and with other glyphs to be readable.

Maybe there could be a second compute shader that "overrides" the brightness and glyphs in a column, storing the result in a separate buffer of cells. This shader could basically scroll the strings down every column, either one after the other or on separate columns, with some gap between them. The open question would then be, what brightness would they be? Maybe they'd be the maximum of whatever brightness is specified in the rain pass, and some minimum brightness, to guarantee the whole thing is readable.

At the moment I'm tied up expanding the default glyph set to include the additions in The Matrix Resurrections, which adds about a hundred new symbols. So support for custom strings probably won't be possible until sometime in 2022. But as long as folks with strings that aren't in the Chicago typeface aren't bothered with some inconsistencies, and even though the existing project isn't optimized for displaying specific text, it's not an unreasonable request. Other projects might be able to more easily accommodate it in the meantime.

from matrix.

LEMONed avatar LEMONed commented on May 14, 2024 1

emojis would be great.

from matrix.

halcyonforever avatar halcyonforever commented on May 14, 2024

That was quite a write up.
Your code is much more complex than the ones I had tinkered with on this before. But none of them included the waves of lighting that would cause the rain to be altered. (or font atlases, learned all about them from reading your code)

from matrix.

Rezmason avatar Rezmason commented on May 14, 2024

I think what we're seeing is a classic technical tradeoff. I set a goal to render the glyphs and their cycling as faithfully as I could to what I'd seen in the trilogy, and made a series of decisions in pursuit of that goal which made the project progressively less capable of displaying dynamic information.

Fortunately, while I'll take a while to get around to experimenting with this particular idea, there are plenty of other interpretations of the code rain on Github that may be better suited for the task!

from matrix.

MWH-Rookie avatar MWH-Rookie commented on May 14, 2024

Still, this is a great idea!

from matrix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.