Hacker News new | past | comments | ask | show | jobs | submit | vg_head's comments login

I'm curious if there's overlap between this and P System: https://en.m.wikipedia.org/wiki/P_system


> Explain to me exactly why, other than 'I guess someone already implemented some kind of basic version of it' that you would have to have custom CPU code rendering glyphs instead of a shader rendering SDF's like literally everyone does with shaders already?

Shaping is different compared to rendering glyphs themselves. SDF renderers (and other GPU text renderers like Slug) still do shaping on the CPU, not in shaders. Maybe some experiments have been done in this area, but I doubt anyone shapes text directly in the GPU in practice.

Think of it like a function that takes text as input, and returns positions as output. Shaders don't really know anything about text. Sure you could probably implement it if you wanted to, but why would you? I think it would add complexity for no benefit (not even performance).


lengyel told me he has implemented some sort of hinting on the gpu for slug (i suspect it's not programmable, but didn't ask)


Very interesting. Honestly I don't know much about hinting, but I suspect the whole shaping stack that Slug supports:

> kerning, ligature replacement, combining diacritical mark placement, and character composition. Slug also supports a number of OpenType features that include stylistic alternates, small caps, oldstyle figures, subscripts, superscripts, case-sensitive punctuation, and fractions.

Probably still uses the CPU.


It's more about the nature of the problem, not that you can't do it in shaders. After all, I think you can do pretty much anything in shaders if you try hard enough.

Even if you already have a GPU renderer for glyphs and any other vector data, you still want to know where to actually position the glyphs. And since this is highly dependent on the text itself and your application state (that lies on the CPU), it would actually be pretty difficult to do it directly on the GPU. The shader that you would want should emit positions, but the code to do that won't be easily ported to the GPU. Working with text is not really what shaders are meant for.


One other thing that is a bit weird about SVG is how some parts don't feel tightly integrated. For example, paths and SMIL events have their own syntax. And a lot of APIs related to them seem to be either abandoned, deprecated, or just hard to find. There's also SVG2 which is confusing, as it seems like no browser will ever implement it fully.

That being said, SVG allows you to create quite beautiful and complex effects with relatively little code.


I've been following VGC for some time now, and I definitely think it's the coolest project of its kind right now! I sincerely hope it will be widely used.


I am too young to have lived through that era, but it seems to me like tweening hints were all integrated in the editing UI? That is of course much more useful. But the scope of my post was not at all to do something better than Flash, or to integrate a full editor. It's just an explanation for one way to achieve it, leveraging what SMIL already offers.


Yeah, they were in the editor and buggy as hell and you ran an increasing risk of crashing the tool the more of them you used. Also IIRC, they were indexed by letter of the alphabet and everything became impossible > 26.


Always open to suggestions! I don't claim this to be any kind of novel method, or even a "good method". It's just an explanation of one way to do it, which is (IMO) relatively easy to understand, and implement.

When researching about this, I didn’t find a lot of writing. Macromedia definitely had this a long time ago, but I don't think you can look up how it was implemented. Not to my knowledge, at least.

Do you have an example of the algorithm you describe? Or a more detailed explanation? I don't quite get how it would work from what you've described.



I haven't looked too in depth into it, but it looks closer to what I described? It doesn’t look like the method the other commenter was describing.

Also, keep in mind that I did not mean to implement something better than what Flash did. It's merely an extension to the kind of morphing the browsers already offer.


This is exactly the kind of tool I would want as well. I was surprised nothing like this exists already.


Sounds like maybe i should build a notification system so if a stock drops a certain percentage below your models estimated value you get alerted?


Yes, at least that would be a great start for me.


I don't know if this is the reason but it is somewhat trivial to roll your own. This is actually close to the story of how I became a programmer in the first place. 17 years ago or so, I made something like this in Excel and figured out how to populate the data from the Yahoo! Finance API, then learned about FRED, BLS, other sources of possibly relevant economic data, but still doing everything in Excel, eventually deciding to learn C++ since I'd heard it was the industry standard for finance. I caught the bug, ended up being more into software than finance specifically, and the rest is history. My motivation at the time was this was the middle of the big global financial crisis, everything had tanked, and it seemed like a great time to get in low. Buying my first house in 2009 was probably the most advantageous thing I did, though I was at least able to do that by tax-free early liquidation of an IRA that was full of self-picked stocks.


I've just finished working on a dead simple OCR tool: https://txtfromimg.com

I know there are plenty of alternatives, but I personally benefit a lot more from a dead simple web page, that does everything locally. It also helps with burnout, I like building very simple, but useful things (at least for myself).

I also have plans for a more serious project though. For a long time now I've been writing down what I would want from a ShaderToy-like website but for SVGs. I feel like there's a lot of potential in making it easy to create and reuse amazing animations with very little code.

I've also seen a lot of people praise the React + SVG combo and I can see why. I'd personally love an environment that I could just spin up instantly, create paths interactively, then create some effects quickly, and then use them wherever I want.


Thank you! Looking forward to your research.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: