浏览代码

Merge pull request #107068 from Calinou/doc-heightmapshape3d-holes

Fix incorrect note about holes in HeightMapShape3D
Thaddeus Crews 3 月之前
父节点
当前提交
e16e6a48f9
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      doc/classes/HeightMapShape3D.xml

+ 3 - 2
doc/classes/HeightMapShape3D.xml

@@ -4,9 +4,9 @@
 		A 3D height map shape used for physics collision.
 	</brief_description>
 	<description>
-		A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D]. This is useful for terrain, but it is limited as overhangs (such as caves) cannot be stored. Holes in a [HeightMapShape3D] are created by assigning very low values to points in the desired area.
+		A 3D heightmap shape, intended for use in physics. Usually used to provide a shape for a [CollisionShape3D]. This type is most commonly used for terrain with vertices placed in a fixed width grid. Due to the nature of the heightmap, it cannot be used to model overhangs or caves, which would require multiple vertices at the same vertical location. Holes can be punched through the collision by assigning [constant @GDScript.NAN] to the height of the desired vertices (this is supported in both GodotPhysics3D and Jolt Physics). You could then insert meshes with their own separate collision to provide overhangs, caves, and so on.
 		[b]Performance:[/b] [HeightMapShape3D] is faster to check collisions against than [ConcavePolygonShape3D], but it is significantly slower than primitive shapes like [BoxShape3D].
-		A heightmap collision shape can also be build by using an [Image] reference:
+		A heightmap collision shape can also be built by using an [Image] reference:
 		[codeblocks]
 		[gdscript]
 		var heightmap_texture = ResourceLoader.load("res://heightmap_image.exr")
@@ -44,6 +44,7 @@
 				Updates [member map_data] with data read from an [Image] reference. Automatically resizes heightmap [member map_width] and [member map_depth] to fit the full image width and height.
 				The image needs to be in either [constant Image.FORMAT_RF] (32 bit), [constant Image.FORMAT_RH] (16 bit), or [constant Image.FORMAT_R8] (8 bit).
 				Each image pixel is read in as a float on the range from [code]0.0[/code] (black pixel) to [code]1.0[/code] (white pixel). This range value gets remapped to [param height_min] and [param height_max] to form the final height value.
+				[b]Note:[/b] Using a heightmap with 16-bit or 32-bit data, stored in EXR or HDR format is recommended. Using 8-bit height data, or a format like PNG that Godot imports as 8-bit, will result in a terraced terrain.
 			</description>
 		</method>
 	</methods>