Files
AnyImage/openspec/changes/pad-cutout-material-edges/specs/cutout-boundary-padding/spec.md
nan 591e62085a feat(cutout): implement boundary padding for cutout textures
- Introduced a new `Boundary Padding` preference in the Cutout Tool with a default of 2 px and a configurable range of 1-4 px.
- Updated the Cutout client to establish inward mapping from the final Mask, sampling in a fixed direction and processing independent material RGBA and Depth.
- Enhanced the handling of RGBA and Depth during cutout operations, ensuring proper mapping and preservation of source data.
- Added tests to validate the new boundary padding functionality and its integration with existing cutout processes.

feat(geometry): remove overall mesh smoothing from geometry nodes

- Removed the `Smooth` input from several geometry node groups to eliminate unnecessary overall mesh smoothing.
- Retained `Smooth Weight` for depth nodes while removing it from Cutout and Relief Plane nodes.
- Ensured that boundary, normal, and fill smoothing behaviors remain intact and consistent.
- Updated tests and documentation to reflect the changes in node interfaces and behaviors.

feat(normals): scale tangent normals with depth

- Reused the existing `o_normal_reduction` attribute to adjust Tangent Normal strength based on the geometry's `Depth Scale`.
- Ensured that Tangent Normal strength is consistent with the geometry depth, preserving full strength for materials that do not provide the attribute.
- Updated tests to verify the correct behavior of normal strength adjustments in both Tangent and Object Space.
2026-09-15 00:40:24 +08:00

3.7 KiB

ADDED Requirements

Requirement: Cutout boundary mapping follows the structural interior

The system SHALL derive one local inward direction from the final Cutout threshold Mask without selecting among content-based donor candidates. For each boundary location it SHALL sample at Boundary Padding pixels along that inward direction and transport the sample through the inner boundary band, boundary and outer padding band.

Scenario: Outer and hole boundaries

  • WHEN the final Cutout Mask contains an outer outline or a hole
  • THEN its mapping points from that boundary into the adjacent filled Mask region

Scenario: Thin structure

  • WHEN the configured inward distance would leave the current Mask along the same ray
  • THEN the mapping stops at the last position inside that Mask without changing direction or searching another donor

Scenario: Undefined local direction

  • WHEN a boundary-band location has no finite nonzero local inward direction
  • THEN that location remains unchanged

Requirement: Material and depth share the Cutout boundary mapping

The system SHALL apply the same structural mapping to the independent Cutout material Color Image and optional Depth Image after raw AI artifacts return and before material or geometry consumption. It SHALL scale the mapping to each target image resolution.

Scenario: Material padding

  • WHEN Boundary Padding is positive
  • THEN the material boundary band receives complete RGBA from its mapped internal location

Scenario: Depth padding

  • WHEN a Depth Cutout has positive Boundary Padding
  • THEN its boundary band receives camera Z and validity from the mapped internal location and camera X/Y are reconstructed for each target pixel from the original intrinsics

Scenario: Different resolutions

  • WHEN material and Depth images have different dimensions
  • THEN both mappings represent the same normalized Cutout boundary and proportional padding width

Requirement: Boundary processing is isolated from source and AI data

The system SHALL preserve the source Image, original Cutout Mask, mesh geometry, UV coordinates, MoGe input, Normal output, intrinsics and reference depth. The server SHALL generate raw Cutout Depth without edge extension.

Scenario: AI Cutout

  • WHEN Cutout requests Depth or Normal generation
  • THEN MoGe processes the unpadded input and only the returned Color and Depth images receive client-side boundary processing

Scenario: Existing depth calibration

  • WHEN client-side Depth padding changes boundary pixels
  • THEN the original Metadata reference depth remains the Cutout calibration reference

Requirement: Boundary Padding is configurable

The system SHALL expose Boundary Padding in Preferences under Cutout Tool as a pixel distance with a default of 2, a minimum of 1 and a maximum of 4. Each Cutout operation SHALL capture the current value and existing objects SHALL remain unchanged.

Scenario: Asynchronous preference change

  • WHEN the preference changes after an AI Cutout starts
  • THEN its response uses the value captured when that operation started

Requirement: Processed images preserve their lifecycle

The system SHALL preserve existing Color and Depth precision, interpretation, ownership and cleanup behavior after client-side boundary processing.

Scenario: Successful creation

  • WHEN a padded Cutout is created successfully
  • THEN its processed independent Color and optional Depth Images are packed with their updated pixels

Scenario: Failed creation

  • WHEN Cutout creation fails after loading either image
  • THEN unowned Blender Images and temporary files are released by the existing cleanup path