3d_text.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. .. _doc_3d_text:
  2. 3D text
  3. =======
  4. Introduction
  5. ------------
  6. In a project, there may be times when text needs to be created as
  7. part of a 3D scene and not just in the HUD. Godot provides two
  8. methods to do this. The Label3D node and the text mesh for a
  9. MeshInstance3D node.
  10. This page does **not** cover how to display a GUI scene in a 3D
  11. environment. For information on how to do that see `this <https://github.com/godotengine/godot-demo-projects/tree/master/viewport/2d_in_3d>`__
  12. demo project.
  13. Label3D
  14. -------
  15. .. image:: img/label_3d.png
  16. Label3D behaves like a label node but in a 3D space. Unlike label
  17. node this can not inherit properties of a GUI theme. However its
  18. look remains customizable and uses the same font subresource
  19. control nodes use.
  20. Label3D has minimal interaction with a 3D environment, it can be lit
  21. up and shaded by light sources if the shaded flag is enabled, but it
  22. will not cast a shadow, even with cast shadow turned on under the nodes
  23. GeometryInstance3D settings. This is because the node is a quad mesh
  24. (one glyph per quad) with transparent textures and has the same limitations
  25. as Sprite3D. See :ref:`this page <doc_3d_rendering_limitations_transparency_sorting>`
  26. for more information.
  27. Text mesh
  28. ---------
  29. .. image:: img/text_mesh.png
  30. Text meshes have similarities to Label3D. They display text in a 3D
  31. scene, and will use the same font subresource. However text is 3D and
  32. has the properties of a mesh. A text mesh cast shadows onto the environment
  33. and can have a material applied to it. Here is an example of a texture and
  34. how it's applied to the mesh.
  35. .. image:: img/text_mesh_texture.png
  36. .. image:: img/text_mesh_textured.png
  37. There are two limitations to text mesh. It can't use bitmap fonts, or fonts
  38. with self intersection.