ComfyUI > Nodes > ComfyUI libigl > Depth Map to Mesh

ComfyUI Node: Depth Map to Mesh

Class Name

GeomPackTextureToGeometry

Category
geompack/texture_remeshing
Author
PozzettiAndrea (Account age: 2240days)
Extension
ComfyUI libigl
Latest Updated
2025-12-22
Github Stars
0.06K

How to Install ComfyUI libigl

Install this extension via the ComfyUI Manager by searching for ComfyUI libigl
  • 1. Click the Manager button in the main menu
  • 2. Select Custom Nodes Manager button
  • 3. Enter ComfyUI libigl in the search bar
After installation, click the Restart button to restart ComfyUI. Then, manually refresh your browser to clear the cache and access the updated list of nodes.

Visit ComfyUI Online for ready-to-use ComfyUI environment

  • Free trial available
  • 16GB VRAM to 80GB VRAM GPU machines
  • 400+ preloaded models/nodes
  • Freedom to upload custom models/nodes
  • 200+ ready-to-run workflows
  • 100% private workspace with up to 200GB storage
  • Dedicated Support

Run ComfyUI Online

Depth Map to Mesh Description

Transforms heightmaps into 3D meshes using algorithms for detailed and realistic models.

Depth Map to Mesh:

The GeomPackTextureToGeometry node, also known as "Depth Map to Mesh," is designed to transform a texture, specifically a heightmap, into a 3D mesh. This node is particularly useful for artists and designers who want to convert 2D texture data into a tangible 3D form, allowing for more dynamic and interactive visualizations. By leveraging various backend algorithms, such as grid-based displacement, Poisson reconstruction, and Delaunay triangulation, this node provides flexibility in how the mesh is generated, catering to different artistic needs and computational resources. The primary goal of this node is to enable the creation of detailed and accurate 3D models from texture data, enhancing the depth and realism of digital art projects.

Depth Map to Mesh Input Parameters:

heightmap

The heightmap is a grayscale image where the intensity of each pixel represents the height at that point. This parameter is crucial as it serves as the foundation for generating the 3D mesh. The heightmap should be normalized, with values typically ranging from 0 to 1. If the maximum value exceeds 1.0, it will be automatically scaled down by dividing by 255.0. This ensures that the height values are within a manageable range for processing.

invert_height

This parameter determines whether the heightmap should be inverted. When set to "true," the height values are flipped, meaning that areas that were previously high become low and vice versa. This can be useful for artistic effects or when the original heightmap is inverted. The default value is "false."

height_scale

Height scale is a multiplier applied to the height values from the heightmap. It controls the vertical exaggeration of the mesh, allowing you to adjust the perceived depth of the generated 3D model. A higher value results in a more pronounced height effect, while a lower value produces a flatter mesh. The default value is typically 1.0, but it can be adjusted based on the desired outcome.

skip_black

This parameter decides whether to ignore black areas in the heightmap during mesh generation. When set to "true," pixels below a certain threshold (defined by black_threshold) are excluded from the mesh, which can be useful for removing unwanted areas or noise. The default value is "false."

black_threshold

Black threshold defines the intensity level below which pixels are considered black and potentially ignored if skip_black is enabled. This allows for fine-tuning of which areas are excluded from the mesh, providing more control over the final output. The default value is typically a low number close to 0.

backend

The backend parameter specifies the algorithm used for mesh generation. Options include "grid" for grid-based displacement, "poisson_pymeshlab" and "poisson_open3d" for Poisson reconstruction, and "delaunay_2d" for 2D Delaunay triangulation. Each backend has its strengths and is suited for different types of meshes and computational resources. The choice of backend can significantly impact the quality and performance of the mesh generation process.

poisson_depth

This parameter is relevant when using Poisson reconstruction backends ("poisson_pymeshlab" or "poisson_open3d"). It defines the depth of the reconstruction, affecting the level of detail in the generated mesh. A higher depth results in a more detailed mesh but requires more computational power. The default value is typically set to a moderate level to balance detail and performance.

smooth_normals

Smooth normals is a boolean parameter that determines whether the normals of the mesh should be smoothed. Smoothing normals can enhance the visual appearance of the mesh by reducing sharp edges and creating a more polished look. The default value is "false," but it can be enabled for a smoother finish.

field

This parameter is used to specify additional data fields that may be included in the mesh generation process. It allows for the inclusion of extra information that can be used to influence the final mesh, providing more customization options for advanced users.

field_name

Field name is the identifier for the additional data field specified in the field parameter. It helps in organizing and referencing the extra data used during mesh generation, ensuring that the correct information is applied to the process.

Depth Map to Mesh Output Parameters:

mesh

The mesh output is the primary result of the node, representing the 3D model generated from the input heightmap. This output is in the form of a triangular mesh (TRIMESH), which can be used in various 3D applications and visualizations. The mesh captures the depth and detail of the original texture, providing a tangible representation of the 2D data.

info

The info output provides additional information about the mesh generation process. This can include details about the backend used, the number of points generated, and any specific settings applied during the process. This output is useful for understanding the context and parameters that influenced the final mesh, aiding in troubleshooting and refinement.

Depth Map to Mesh Usage Tips:

  • Experiment with different backends to find the one that best suits your artistic needs and computational resources. Each backend offers unique advantages and can produce varying results.
  • Adjust the height scale to achieve the desired level of depth in your mesh. This can significantly impact the visual appeal and realism of the final model.
  • Use the skip_black and black_threshold parameters to clean up unwanted areas in your heightmap, ensuring a more refined and focused mesh output.

Depth Map to Mesh Common Errors and Solutions:

Unknown backend: <backend_name>

  • Explanation: This error occurs when an invalid or unsupported backend is specified in the parameters.
  • Solution: Ensure that the backend parameter is set to one of the supported options: "grid," "poisson_pymeshlab," "poisson_open3d," or "delaunay_2d."

Heightmap normalization issue

  • Explanation: If the heightmap values exceed the expected range, it may lead to incorrect mesh generation.
  • Solution: Verify that the heightmap is properly normalized, with values ranging from 0 to 1. If necessary, adjust the input image or ensure that the node's automatic scaling is applied correctly.

Depth Map to Mesh Related Nodes

Go back to the extension to check out more related nodes.
ComfyUI libigl
RunComfy
Copyright 2025 RunComfy. All Rights Reserved.

RunComfy is the premier ComfyUI platform, offering ComfyUI online environment and services, along with ComfyUI workflows featuring stunning visuals. RunComfy also provides AI Models, enabling artists to harness the latest AI tools to create incredible art.