material.rst 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. Materials
  2. =========
  3. Using existing Godot materials
  4. ------------------------------
  5. One way in which the exporter can handle materials is to attempt to match
  6. the Blender material with an existing Godot material. This has the advantage of
  7. being able to use all of the features of Godot's material system, but it means
  8. that you cannot see your model with the material applied inside Blender.
  9. To do this, the exporter attempts to find Godot materials with names that match
  10. those of the material name in Blender. So if you export an object in Blender
  11. with the material name ``PurpleDots`` then the exporter will search for the
  12. file ``PurpleDots.tres`` and assign it to the object. If this file is not a
  13. ``StandardMaterial3D`` or ``ShaderMaterial`` or if it cannot be found, then the
  14. exporter will fall back to exporting the material from Blender.
  15. Where the exporter searches for the ``.tres`` file is determined by the "Material
  16. Search Paths" option:
  17. .. image:: img/material_search.jpg
  18. This can take the value of:
  19. - Project Directory - Attempts to find the ``project.Godot`` and recursively
  20. searches through subdirectories. If ``project.Godot`` cannot be found it
  21. will throw an error. This is useful for most projects where naming conflicts
  22. are unlikely.
  23. - Export Directory - Look for materials in subdirectories of the export
  24. location. This is useful for projects where you may have duplicate
  25. material names and need more control over what material gets assigned.
  26. - None - Do not search for materials. Export them from the Blender file.
  27. Export of Cycles/EEVEE materials
  28. --------------------------------
  29. The exporter has a primitive support for converting Cycles/EEVEE material node tree
  30. to Godot Shader Material. Note that some of the Shader Node are not supported yet due to
  31. difficulties in implementation, which are:
  32. - all the ``noisy textures``
  33. - ``generated texture coordinates``
  34. - ``group node``
  35. - shader nodes except ``PrincipledBSDF``, ``Diffuse``, ``Glossy``, ``Glass``, ``add shader`` and ``mix shader``
  36. .. warning::
  37. If possible, try to use PrincipledBSDF node with GGX distribution as the output shader
  38. node, it is the only one guaranteed to be exactly correct. Others are just based on approximation.
  39. Sometimes materials may not be valid for exporting (e.g. has some unsupported node) or it
  40. is using Blender Internal Engine, only the diffuse color and a few flags (e.g. unshaded) are
  41. exported and form a StandardMaterial3D.
  42. Generate external materials
  43. ---------------------------
  44. The default configuration of material exporting would keep all the materials internal to
  45. the ``escn`` file. There is an option which could enable generating external ``.material``
  46. file when the ``escn`` file opens in Godot.
  47. .. image:: img/external_mat_option.jpg
  48. ``.material`` file can be assigned to any material slot to be a external resource.
  49. .. image:: img/gd_dot_material.jpg