facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.23k forks source link

[Feature Request] 3D text/font support #94

Closed erinjerri closed 6 years ago

erinjerri commented 7 years ago

I redownloaded the starter templates to get a feel for the font usage again as I mentioned to your team earlier this last week at SVVR 2017. I did indeed build small projects online I had not pushed on GH, but was mainly concerned with the limited functionality of 3D text/font.

Expected behavior

In the documentation here [(https://facebook.github.io/react-vr/docs/fonts.html)], I was wondering why the ReactVR team did not choose to adopt more of the spec at MozVR's A-Frame as shown here [https://aframe.io/examples/showcase/hello-metaverse/] and here [https://www.npmjs.com/package/aframe-text-geometry-component]. I'm assuming because it is stated that under options that it is a preference issue, but not an optimization or functionality issue to utilize three.js Text Geometry for making 3D-like text/fonts as opposed to fonts in flat-UI?

"Options" One option is to use geometry fonts as used in three.js TextGeometry however this can be computationally expensive for large quantities of text. A second option is to use the browser to generate text blocks and then make these available through html5 canvas bitmaps to OpenGLES textures used by React VR. However, the difficulty with this approach is determining an ideal rendering size that strikes a proper balance between minimizing blur and managing the amount of texture memory required."

Was this decision bc of optimization and texture compression being more difficult on mobileVR devices? My request would be to include more extensive documentation to push this to the limit, obviously there would come a point where optimization would become an issue.

Additional Information

mikearmstrong001 commented 7 years ago

The React VR focus is to establish a compatible runtime for React Native, and then extend from there.

When looking at the needs of products the requirement is mainly antialiased bitmap based text (we chose Signed distance Field fonts to achieve this). Bitmap fonts are have the advantage of much less geometry on mobile and the SDF format allows us to zoom into the glyph elements without pixelization.

TextGeometry could be supported in the future in a similar way to how we support objects and meshes