Remix.run Logo
talkingtab 7 days ago

There is a real problem using canvas to replace HTML.

Not all but most HTML. I have not found a good solution for the issue of doing something like MDX in canvas. I have tried SDF, looked at 2D canvas Text, Troika, MSDF. You can get text, it is just that laying it out is very difficult. React three drei has the ability to put HTML into the threejs ecosystem, but there are issues about CSS and text that make that impractical.

For me the use case is very simple. I would like to take an MDX file and show it in a mesh. Laid out. Maybe I am missing something because I am new to the whole threejs thing, but I really tried.

A good article about text https://css-tricks.com/techniques-for-rendering-text-with-we...

And an example from the above article: https://codesandbox.io/p/sandbox/css-tricks-msdf-text-fks8w

This shows it can be done, I gave up trying to reproduce it in React-three-fiber.

Why? Personally, I think the use of 3D graphics produces an interface for users that is an order or magnitude better for users. The real question (and an interesting one to consider) is why are we still building HTML first websites?

squidbeak 7 days ago | parent [-]

Why do we build HTML first websites? Because most websites serve documents, however much developers might wish they were applications.