Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated docs for VoxelTool class family #683

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions doc/classes/VoxelTool.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,39 +41,47 @@
<param index="0" name="begin" type="Vector3i" />
<param index="1" name="end" type="Vector3i" />
<description>
Operate on a rectangular cuboid section of the terrain. [code]begin[/code] and [code]end[/code] are inclusive. Choose operation and which voxel to use by setting [code]value[/code] and [code]mode[/code] before calling this function.
Operate on a rectangular cuboid section of the terrain. [code]begin[/code] and [code]end[/code] are inclusive.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, end is not inclusive with smooth voxels. For example if you pass (0,0,0) and (0,0,0), that's an empty box and it won't do anything. It might have been a mistake that the blocky mode was inconsistent, because generally I code everything dealing with boxes using an exclusive max point. But thats how things have been so far, it's quite old.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay, then I'll try to reflect that in revised description.^^'

You must choose operation by setting [code]mode[/code] and set parameters relevant to the type of tool before calling this function.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true of every operation, so I'm not sure how relevant it is to indicate that on do_box specifically?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I thought of linking every do_* op to Box as the most documented one, but now I'm thinking that maybe this and the next comment can be moved to ''Using VoxelTool" section of Scripting article in the main doc. Maybe even with code examples and stuff. Does it sound reasonable?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice, but at the same time it requires putting absolute links in there, while it could also be in the description of the class. But I dont think we can link to that description somehow.

If working with blocky terrain, you can choose which voxel to use by setting [member value].
If working with smooth terrain, use [member sdf_scale] and [member sdf_strength] in [constant VoxelTool.MODE_ADD] or [constant VoxelTool.MODE_REMOVE]. See also [constant VoxelTool.MODE_TEXTURE_PAINT].
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once again, not sure if all this should be indicated here, because that's true of many do_* functions. In addition, sdf_scale is getting less recommended unless you know what you're doing, it was originally present to allow improving the encoding fixed-point scale, which is now automatic.

</description>
</method>
<method name="do_path">
<return type="void" />
<param index="0" name="points" type="PackedVector3Array" />
<param index="1" name="radii" type="PackedFloat32Array" />
<description>
Performs an edit similar to `do_sphere` along a spline defined by `points`.
Copy link
Owner

@Zylann Zylann Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a spline, it's a list of points connected by linear segments. They are not smoothed out. Not sure how to call that, but a spline is something different.
Also radii (radius, plural) needs to be explained, it is the width of the "tube" along each point.
Internally, this is equivalent to carving/building capsules end-to-end, where the radius of the base and the top of each capsule is taken from the radii. The original reason I started exposing that function was to do cave worms.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see! So maybe something like

"Performs an edit along a series of tubular sections with junctions defined by points array. radii (plural of radius) array defines tube's thickness at the point with corresponding index. The main purpose of this function is efficiently carving tunnels."

Copy link
Contributor

@Poikilos Poikilos Aug 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a spline, it's a list of points connected by linear segments. They are not smoothed out. Not sure how to call that, but a spline is something different.

Polyline is probably the best term. It may be lingo, but is used in various open APIs and in AutoCAD.

</description>
</method>
<method name="do_point">
<return type="void" />
<param index="0" name="pos" type="Vector3i" />
<description>
Used to edit single voxels. More useful with Blocky terrain, and might not look nice if editing [VoxelBuffer.CHANNEL_SDF].
</description>
</method>
<method name="do_sphere">
<return type="void" />
<param index="0" name="center" type="Vector3" />
<param index="1" name="radius" type="float" />
<description>
Operate on all voxels in `radius` around `point`. See also [method do_box].
</description>
</method>
<method name="get_voxel">
<return type="int" />
<param index="0" name="pos" type="Vector3i" />
<description>
Gets data from voxel at `pos` coordinates as an unsigned integer. This is an encoded value, so non-integer values may be obtained by converting it. The kind of data you get depends on [member channel] the tool is set to.
</description>
</method>
<method name="get_voxel_f">
<return type="float" />
<param index="0" name="pos" type="Vector3i" />
<description>
Returns data from voxel at `pos` coordinates as float. If set to operate on [constant VoxelBuffer.CHANNEL_SDF] returns the voxel's SDF value.
Copy link
Owner

@Zylann Zylann Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that the channel doesn't actually matter: it will always decode voxel data the same way. But it is indeed meant to read SDF values. Also, the range of precision is not exactly like a float, it is set to quantized values when using 8-bit and 16-bit depths, which are tuned for signed distances. However when using 32-bit it does use actual floats.
This is actually something that boils down to VoxelBuffer, because that's where this encoding/decoding takes place.
Anyways, not sure if it needs all these details, "float" is ok, but it's just that not the full range of float values work here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to distill the details and got something like this:
"Returns data from voxel at pos coordinates as a float value. This method is intended to read SDF values and will be decoded as such regardless of the channel value of the tool.
Note: Return value's actual precision depends on VoxelBuffer.Depth set for the SDF channel."

</description>
</method>
<method name="get_voxel_metadata" qualifiers="const">
Expand All @@ -100,12 +108,14 @@
<return type="bool" />
<param index="0" name="box" type="AABB" />
<description>
Returns false if the blocks within `box` are not fully loaded. Not implemented in this class, because it only makes sense if editing with [VoxelToolTerrain] or [VoxelToolLodTerrain]
Copy link
Owner

@Zylann Zylann Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if it should say that it's not implemented in this class? Because that method won't appear in derived classes in the docs. Also it should already being known that VoxelTool itself should never be used as-is, it's only a base class acting as a common interface. The woes of OOP inheritance docs :p

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, yeah, I wrote this looking at base implementation without realizing it won't appear in child class docs. I'm new to this xD
If links to main docs will work, maybe it can mention "Useful to check if edited area is within bounds and in LOD0 in case of LOD terrain" and link back to the section about this in Scripting.

</description>
</method>
<method name="normalize_color" qualifiers="static">
<return type="Color" />
<param index="0" name="_unnamed_arg0" type="Color" />
<description>
A helper method to set the sum of channels of the `Color` to 1.
</description>
</method>
<method name="paste">
Expand Down Expand Up @@ -230,7 +240,7 @@
Set which channel will be edited. When used on a terrain node, it will default to the first available channel, based on the stream and generator.
</member>
<member name="eraser_value" type="int" setter="set_eraser_value" getter="get_eraser_value">
Sets which value will be used to erase voxels when editing the [constant VoxelBuffer.CHANNEL_TYPE] channel in [constant MODE_REMOVE] mode.
Sets which value will be used to erase voxels when editing the [constant VoxelBuffer.CHANNEL_TYPE] channel in [constant MODE_REMOVE] mode. Only relevant for Blocky voxels.
</member>
<member name="mode" type="int" setter="set_mode" getter="get_mode" enum="VoxelTool.Mode">
Sets how [code]do_*[/code] functions will behave. This may vary depending on the channel.
Expand All @@ -240,13 +250,17 @@

This is related to the [enum VoxelBuffer.Depth] configuration on voxels. For 8-bit and 16-bit, there is a limited range of values the Signed Distance Field can take, and by default it is clamped to -1..1, so the gradient can only range across 2 voxels. But when LOD is used, it is better to stretch that range over a longer distance, and this is achieved by scaling SDF values.
</member>
<member name="sdf_strength" type="float" setter="set_sdf_strength" getter="get_sdf_strength">
<member name="sdf_strength" type="float" setter="set_sdf_strength" getter="get_sdf_strength" default="1.0">
When editing [constant VoxelBuffer.CHANNEL_SDF] of Smooth Terrains in [constant VoxelTool.MODE_ADD] or [constant VoxelTool.MODE_REMOVE] determines the interpolation phase between current values and values set by the tool. Effectively represents the amount of "matter" added or subtracted.
</member>
<member name="texture_falloff" type="float" setter="set_texture_falloff" getter="get_texture_falloff">
<member name="texture_falloff" type="float" setter="set_texture_falloff" getter="get_texture_falloff" default="0.5">
Range [0.001..1.0]. Determines texture blending strength when tool is set to [constant VoxelTool.MODE_TEXTURE_PAINT]. Lower values produce sharper transitions. Can be compared to brush softness in an image editing program.
</member>
<member name="texture_index" type="int" setter="set_texture_index" getter="get_texture_index">
Determines which texture's weights will be edited when tool is set to [constant VoxelTool.MODE_TEXTURE_PAINT].
</member>
<member name="texture_opacity" type="float" setter="set_texture_opacity" getter="get_texture_opacity">
<member name="texture_opacity" type="float" setter="set_texture_opacity" getter="get_texture_opacity" default="1.0">
Range [0.0..1.0]. Determines the maximum weight of a [member texture_index] when tool is set to [constant VoxelTool.MODE_TEXTURE_PAINT]. Can be compared to brush opacity in an image editing program.
</member>
<member name="value" type="int" setter="set_value" getter="get_value">
Sets which voxel value will be used. This is not relevant when editing [constant VoxelBuffer.CHANNEL_SDF].
Expand All @@ -263,6 +277,7 @@
Replace voxel values without any blending. Useful for blocky voxels.
</constant>
<constant name="MODE_TEXTURE_PAINT" value="3" enum="Mode">
When editing [constant VoxelBuffer.CHANNEL_SDF] in Smooth Terrain, enables texture painting. The value of [member texture_index] will be added to texture indices of the affected voxels. The texture's weight will be blended based on the values of [member texture_falloff] and [member texture_opacity].
</constant>
</constants>
</class>
2 changes: 2 additions & 0 deletions doc/classes/VoxelToolLodTerrain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<param index="1" name="transform" type="Transform3D" />
<param index="2" name="area_size" type="Vector3" />
<description>
Allows using a [VoxelGeneratorGraph] as a brush, which opens possibility for various advanced scenarios. See [related article](../Generators.md#using-voxelgeneratorgraph-as-a-brush).
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[related has no precedent in Godot's documentation. XML files follow features supported by Godot, because this is the same file used to display API docs in the editor.
Maybe you should use the [url=https://...]text[/url] syntax?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, yeah. 'related' is not intended as a keyword here, it's just "related article" x) I'll try the new syntax and see if the bbcode converter still complains at me.^^

</description>
</method>
<method name="do_hemisphere">
Expand All @@ -25,6 +26,7 @@
<param index="2" name="flat_direction" type="Vector3" />
<param index="3" name="smoothness" type="float" default="0.0" />
<description>
See [method VoxelToolTerrain.do_hemisphere].
</description>
</method>
<method name="do_sphere_async">
Expand Down
1 change: 1 addition & 0 deletions doc/classes/VoxelToolTerrain.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
<param index="2" name="flat_direction" type="Vector3" />
<param index="3" name="smoothness" type="float" default="0.0" />
<description>
Operates on a hemisphe, where the "dome" part's summit is pointed in `flat_direction`. `smoothness` determines how the flat part blends with the rounded part, with higher values producing softer more rounded edge.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "hemisphe"

flat_direction is actually supposed to point away from the flat side. If that's not the case I think it should be fixed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nö, my bad!^^'

With flat_direction I was expecting it to work as you say, but yeah, it's flipped.

//funcs.h:353
math::sdf_smooth_subtract( //
	math::sdf_sphere(pos, center, radius), //
	math::sdf_plane(pos, flat_direction, plane_d),
	smoothness
);

</description>
</method>
<method name="for_each_voxel_metadata_in_area">
Expand Down
48 changes: 27 additions & 21 deletions doc/source/api/VoxelTool.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ Type | Name
[int](https://docs.godotengine.org/en/stable/classes/class_int.html) | [eraser_value](#i_eraser_value) |
[int](https://docs.godotengine.org/en/stable/classes/class_int.html) | [mode](#i_mode) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [sdf_scale](#i_sdf_scale) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [sdf_strength](#i_sdf_strength) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [texture_falloff](#i_texture_falloff) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [sdf_strength](#i_sdf_strength) | 1.0
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [texture_falloff](#i_texture_falloff) | 0.5
[int](https://docs.godotengine.org/en/stable/classes/class_int.html) | [texture_index](#i_texture_index) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [texture_opacity](#i_texture_opacity) |
[float](https://docs.godotengine.org/en/stable/classes/class_float.html) | [texture_opacity](#i_texture_opacity) | 1.0
[int](https://docs.godotengine.org/en/stable/classes/class_int.html) | [value](#i_value) |
<p></p>

Expand Down Expand Up @@ -68,7 +68,7 @@ enum **Mode**:
- <span id="i_MODE_ADD"></span>**MODE_ADD** = **0** --- When editing [VoxelBuffer.CHANNEL_SDF](VoxelBuffer.md#i_CHANNEL_SDF), will add matter. Useful for building.
- <span id="i_MODE_REMOVE"></span>**MODE_REMOVE** = **1** --- When editing [VoxelBuffer.CHANNEL_SDF](VoxelBuffer.md#i_CHANNEL_SDF), will subtract matter. Useful for digging.
- <span id="i_MODE_SET"></span>**MODE_SET** = **2** --- Replace voxel values without any blending. Useful for blocky voxels.
- <span id="i_MODE_TEXTURE_PAINT"></span>**MODE_TEXTURE_PAINT** = **3**
- <span id="i_MODE_TEXTURE_PAINT"></span>**MODE_TEXTURE_PAINT** = **3** --- When editing [VoxelBuffer.CHANNEL_SDF](VoxelBuffer.md#i_CHANNEL_SDF) in Smooth Terrain, enables texture painting. The value of [VoxelTool.texture_index](VoxelTool.md#i_texture_index) will be added to texture indices of the affected voxels. The texture's weight will be blended based on the values of [VoxelTool.texture_falloff](VoxelTool.md#i_texture_falloff) and [VoxelTool.texture_opacity](VoxelTool.md#i_texture_opacity).


## Property Descriptions
Expand All @@ -79,7 +79,7 @@ Set which channel will be edited. When used on a terrain node, it will default t

### [int](https://docs.godotengine.org/en/stable/classes/class_int.html)<span id="i_eraser_value"></span> **eraser_value**

Sets which value will be used to erase voxels when editing the [VoxelBuffer.CHANNEL_TYPE](VoxelBuffer.md#i_CHANNEL_TYPE) channel in [VoxelTool.MODE_REMOVE](VoxelTool.md#i_MODE_REMOVE) mode.
Sets which value will be used to erase voxels when editing the [VoxelBuffer.CHANNEL_TYPE](VoxelBuffer.md#i_CHANNEL_TYPE) channel in [VoxelTool.MODE_REMOVE](VoxelTool.md#i_MODE_REMOVE) mode. Only relevant for Blocky voxels.

### [int](https://docs.godotengine.org/en/stable/classes/class_int.html)<span id="i_mode"></span> **mode**

Expand All @@ -92,21 +92,21 @@ When working with smooth voxels, applies a scale to the signed distance field. A

This is related to the [VoxelBuffer.Depth](VoxelBuffer.md#enumerations) configuration on voxels. For 8-bit and 16-bit, there is a limited range of values the Signed Distance Field can take, and by default it is clamped to -1..1, so the gradient can only range across 2 voxels. But when LOD is used, it is better to stretch that range over a longer distance, and this is achieved by scaling SDF values.

### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_sdf_strength"></span> **sdf_strength**
### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_sdf_strength"></span> **sdf_strength** = 1.0

*(This property has no documentation)*
When editing [VoxelBuffer.CHANNEL_SDF](VoxelBuffer.md#i_CHANNEL_SDF) of Smooth Terrains in [VoxelTool.MODE_ADD](VoxelTool.md#i_MODE_ADD) or [VoxelTool.MODE_REMOVE](VoxelTool.md#i_MODE_REMOVE) determines the interpolation phase between current values and values set by the tool. Effectively represents the amount of "matter" added or subtracted.

### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_texture_falloff"></span> **texture_falloff**
### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_texture_falloff"></span> **texture_falloff** = 0.5

*(This property has no documentation)*
Range [0.001..1.0]. Determines texture blending strength when tool is set to [VoxelTool.MODE_TEXTURE_PAINT](VoxelTool.md#i_MODE_TEXTURE_PAINT). Lower values produce sharper transitions. Can be compared to brush softness in an image editing program.

### [int](https://docs.godotengine.org/en/stable/classes/class_int.html)<span id="i_texture_index"></span> **texture_index**

*(This property has no documentation)*
Determines which texture's weights will be edited when tool is set to [VoxelTool.MODE_TEXTURE_PAINT](VoxelTool.md#i_MODE_TEXTURE_PAINT).

### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_texture_opacity"></span> **texture_opacity**
### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_texture_opacity"></span> **texture_opacity** = 1.0

*(This property has no documentation)*
Range [0.0..1.0]. Determines the maximum weight of a [VoxelTool.texture_index](VoxelTool.md#i_texture_index) when tool is set to [VoxelTool.MODE_TEXTURE_PAINT](VoxelTool.md#i_MODE_TEXTURE_PAINT). Can be compared to brush opacity in an image editing program.

### [int](https://docs.godotengine.org/en/stable/classes/class_int.html)<span id="i_value"></span> **value**

Expand All @@ -132,27 +132,33 @@ Copies voxels in a box and stores them in the passed buffer.

### [void](#)<span id="i_do_box"></span> **do_box**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) begin, [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) end )

Operate on a rectangular cuboid section of the terrain. `begin` and `end` are inclusive. Choose operation and which voxel to use by setting `value` and `mode` before calling this function.
Operate on a rectangular cuboid section of the terrain. `begin` and `end` are inclusive.

You must choose operation by setting `mode` and set parameters relevant to the type of tool before calling this function.

If working with blocky terrain, you can choose which voxel to use by setting [VoxelTool.value](VoxelTool.md#i_value).

If working with smooth terrain, use [VoxelTool.sdf_scale](VoxelTool.md#i_sdf_scale) and [VoxelTool.sdf_strength](VoxelTool.md#i_sdf_strength) in [VoxelTool.MODE_ADD](VoxelTool.md#i_MODE_ADD) or [VoxelTool.MODE_REMOVE](VoxelTool.md#i_MODE_REMOVE). See also [VoxelTool.MODE_TEXTURE_PAINT](VoxelTool.md#i_MODE_TEXTURE_PAINT).

### [void](#)<span id="i_do_path"></span> **do_path**( [PackedVector3Array](https://docs.godotengine.org/en/stable/classes/class_packedvector3array.html) points, [PackedFloat32Array](https://docs.godotengine.org/en/stable/classes/class_packedfloat32array.html) radii )

*(This method has no documentation)*
Performs an edit similar to `do_sphere` along a spline defined by `points`.

### [void](#)<span id="i_do_point"></span> **do_point**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) pos )

*(This method has no documentation)*
Used to edit single voxels. More useful with Blocky terrain, and might not look nice if editing [VoxelBuffer.CHANNEL_SDF](https://docs.godotengine.org/en/stable/classes/class_voxelbuffer.channel_sdf.html).

### [void](#)<span id="i_do_sphere"></span> **do_sphere**( [Vector3](https://docs.godotengine.org/en/stable/classes/class_vector3.html) center, [float](https://docs.godotengine.org/en/stable/classes/class_float.html) radius )

*(This method has no documentation)*
Operate on all voxels in `radius` around `point`. See also [VoxelTool.do_box](VoxelTool.md#i_do_box).

### [int](https://docs.godotengine.org/en/stable/classes/class_int.html)<span id="i_get_voxel"></span> **get_voxel**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) pos )

*(This method has no documentation)*
Gets data from voxel at `pos` coordinates as an unsigned integer. This is an encoded value, so non-integer values may be obtained by converting it. The kind of data you get depends on [VoxelTool.channel](VoxelTool.md#i_channel) the tool is set to.

### [float](https://docs.godotengine.org/en/stable/classes/class_float.html)<span id="i_get_voxel_f"></span> **get_voxel_f**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) pos )

*(This method has no documentation)*
Returns data from voxel at `pos` coordinates as float. If set to operate on [VoxelBuffer.CHANNEL_SDF](VoxelBuffer.md#i_CHANNEL_SDF) returns the voxel's SDF value.

### [Variant](https://docs.godotengine.org/en/stable/classes/class_variant.html)<span id="i_get_voxel_metadata"></span> **get_voxel_metadata**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) pos )

Expand All @@ -174,11 +180,11 @@ Note 2: This is meant to be analogous to Surface tool from Unreal Engine Voxel P

### [bool](https://docs.godotengine.org/en/stable/classes/class_bool.html)<span id="i_is_area_editable"></span> **is_area_editable**( [AABB](https://docs.godotengine.org/en/stable/classes/class_aabb.html) box )

*(This method has no documentation)*
Returns false if the blocks within `box` are not fully loaded. Not implemented in this class, because it only makes sense if editing with [VoxelToolTerrain](VoxelToolTerrain.md) or [VoxelToolLodTerrain](VoxelToolLodTerrain.md)

### [Color](https://docs.godotengine.org/en/stable/classes/class_color.html)<span id="i_normalize_color"></span> **normalize_color**( [Color](https://docs.godotengine.org/en/stable/classes/class_color.html) _unnamed_arg0 )

*(This method has no documentation)*
A helper method to set the sum of channels of the `Color` to 1.

### [void](#)<span id="i_paste"></span> **paste**( [Vector3i](https://docs.godotengine.org/en/stable/classes/class_vector3i.html) dst_pos, [VoxelBuffer](VoxelBuffer.md) src_buffer, [int](https://docs.godotengine.org/en/stable/classes/class_int.html) channels_mask )

Expand Down Expand Up @@ -264,4 +270,4 @@ Decodes raw voxel integer data from the WEIGHTS channel into a normalized 4-floa

Encodes a 4-integer vector into 16-bit integer voxel data, for use in the INDICES channel.

_Generated on Apr 06, 2024_
_Generated on Aug 12, 2024_
Loading