Răsfoiți Sursa

Document how to apply prototype textures to CSG nodes

Hugo Locurcio 5 ani în urmă
părinte
comite
30ef0c80a3
1 a modificat fișierele cu 38 adăugiri și 0 ștergeri
  1. 38 0
      tutorials/3d/csg_tools.rst

+ 38 - 0
tutorials/3d/csg_tools.rst

@@ -235,3 +235,41 @@ this:
 You've successfully prototyped a room level with the CSG tools in Godot.
 CSG tools can be used for designing all kinds of levels, such as a maze
 or a city; explore its limitations when designing your game.
+
+Using prototype textures
+------------------------
+
+Godot's :ref:`doc_spatial_material` supports *triplanar mapping*, which can be
+used to automatically apply a texture to arbitrary objects without distortion.
+This is handy when using CSG as Godot doesn't support editing UV maps on CSG
+nodes yet. Triplanar mapping is relatively slow, which usually restricts its
+usage to organic surfaces like terrain. Still, when prototyping, it can be used
+to quickly apply textures to CSG-based levels.
+
+.. note:: If you need some textures for prototyping, Kenney made a
+          `set of CC0-licensed prototype textures <https://kenney.nl/assets/prototype-textures>`__.
+
+There are two ways to apply a material to a CSG node:
+
+- Applying it to a CSGCombiner node as a material override
+  (**Geometry > Material Override** in the Inspector). This will affect its
+  children automatically, but will make it impossible to change the material in
+  individual children.
+- Applying a material to individual nodes (**Material** in the Inspector). This
+  way, each CSG node can have its own appearance. Subtractive CSG nodes will
+  apply their material to the nodes they're "digging" into.
+
+To apply triplanar mapping to a CSG node, select it, go to the Inspector, click
+the **[empty]** text next to **Material Override** (or **Material** for
+individual CSG nodes). Choose **New SpatialMaterial**. Click the newly created
+material's icon to edit it. Unfold the **Albedo** section and load a texture
+into the **Texture** property. Now, unfold the **Uv1** section and check
+**Triplanar**. You can change the texture offset and scale on each axis by
+playing with the **Scale** and **Offset** properties just above. Higher values
+in the **Scale** property will cause the texture to repeat more often.
+
+.. tip:: You can copy a SpatialMaterial to reuse it across CSG nodes. To do so,
+         click the dropdown arrow next to a material property in the Inspector
+         and choose **Copy**. To paste it, select the node you'd like to apply
+         the material onto, click the dropdown arrow next to its material
+         property then choose **Paste**.