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.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-09-14
|
||||
33
openspec/changes/remove-geometry-node-smoothing/design.md
Normal file
33
openspec/changes/remove-geometry-node-smoothing/design.md
Normal file
@@ -0,0 +1,33 @@
|
||||
## Context
|
||||
|
||||
五个主节点组在业务几何完成后调用共享 `expand_smooth()`,由公开的 `Smooth` 与 `Smooth Weight` 控制整体顶点位置平滑。三个深度节点组还通过同一个 `Smooth Weight` 驱动 `Boundary Smooth`;`O Image Cutout` 与 `O Image Relief Plane` 则没有该权重的其他消费者。项目同时存在 `Boundary Smooth`、`Normal Smooth`、`Fill Smooth` 和 shade smooth,它们分别承担切边修整、位移法线处理、填充墙体构造与着色职责,不属于待移除的末端整体 smooth。
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
|
||||
- 移除五个主节点组输出前的整体 `expand_smooth()` 后处理及其 `Smooth` 接口。
|
||||
- 按真实消费关系处理 `Smooth Weight`:深度节点组保留,Cutout 与 Relief Plane 删除。
|
||||
- 保持边界、法线、填充墙体与着色平滑行为不变。
|
||||
- 使源码、保存的节点资产、接口测试与行为测试保持一致。
|
||||
|
||||
**Non-Goals:**
|
||||
|
||||
- 不移除或重新调参 `Boundary Smooth`、`Normal Smooth`、`Fill Smooth`。
|
||||
- 不取消 `GeometryNodeSetShadeSmooth` 或 Blender object polygon 的 smooth shading。
|
||||
- 不改变生成前的轮廓平滑、深度字段模糊或其他不位于主输出末端的专用算法。
|
||||
|
||||
## Decisions
|
||||
|
||||
1. 以“主几何构建完成后,由 `Smooth` socket 控制的 `expand_smooth()`”作为删除边界。这样可直接对应用户可见接口和五条真实调用链,避免把名称含 smooth 的不同业务误删。备选方案是删除所有含 smooth 的节点,但会破坏边界、法线和墙体生成能力。
|
||||
2. 五个节点组均删除 `Smooth` socket,并把原本送入整体平滑的几何直接连接至现有 shade smooth 或 group output。此方式不引入旁路或兼容 socket,符合项目不保留旧路径的约束。
|
||||
3. `Smooth Weight` 按消费者保留:`O Image Depth Cutout`、`O Image Depth Plane`、`O Image Depth Panorama` 继续用于 `smooth_cut_boundary()`;`O Image Cutout` 与 `O Image Relief Plane` 删除该 socket。共享 `expand_smooth()` 仍由边界平滑实现使用,因此保留公共实现。
|
||||
4. 测试从“整体 smooth 可配置”改为验证接口不存在、未追加整体平滑、专用平滑仍有效。节点组逻辑与接口变化后执行规定的 `uv run node-group build`,由构建流程更新并验证 `.blend` 资产。
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- [已有文件中的 modifier 仍保存旧 socket 值] → 这是明确的接口破坏;不提供兼容层,新资产和新建对象只暴露当前接口。
|
||||
- [删除整体平滑后表面更忠实但可能更显离散] → 由细分密度及各专用平滑控制负责各自质量,不重新引入通用末端处理。
|
||||
- [误删共享权重或公共 helper] → 以调用图和节点接口测试确认三个边界平滑消费者仍连接,公共 helper 仍被 `boundary_smoothing.py` 引用。
|
||||
- [保存资产与源码漂移] → 必须运行节点资产构建,并执行相关节点与 operator 测试后检查旧接口引用。
|
||||
|
||||
27
openspec/changes/remove-geometry-node-smoothing/proposal.md
Normal file
27
openspec/changes/remove-geometry-node-smoothing/proposal.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## Why
|
||||
|
||||
几何节点组当前在主体几何构建完成后提供一轮可选的整体 mesh smooth,既增加节点接口与实现复杂度,也会软化已经确定的表面细节。应移除这类末端后处理,同时保留边界平滑、法线平滑等独立业务所需的控制与权重。
|
||||
|
||||
## What Changes
|
||||
|
||||
- **BREAKING**:从所有相关几何节点组公开接口移除 `Smooth` 输入,生成结果不再执行末端整体 mesh smooth。
|
||||
- 删除仅服务于末端整体 smooth 的节点链、构建调用与测试约束。
|
||||
- `Smooth Weight` 若仍被 `Boundary Smooth` 等独立处理使用则保留;若只控制已删除的末端 smooth,则连同接口与相关逻辑删除。
|
||||
- 保留 `Boundary Smooth`、`Normal Smooth`、shade smooth,以及深度/轮廓生成过程中的其他专用平滑行为。
|
||||
- 重建并验证 `O_AnyImage.blend`,同步节点组接口清单、布局预期及相关内部说明。
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
- `geometry-node-smoothing`: 规定几何节点输出不得追加整体 mesh smooth,并明确专用平滑控制及共享权重的保留规则。
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
无。
|
||||
|
||||
## Impact
|
||||
|
||||
- 影响 `O Image Cutout`、`O Image Depth Cutout`、`O Image Depth Plane`、`O Image Depth Panorama`、`O Image Relief Plane` 的公开 modifier 接口与生成图。
|
||||
- 影响 `tools/nodes/groups`、共享 smoothing 构建代码的实际引用、节点资产与节点相关测试。
|
||||
- 现有依赖 `Smooth` socket identifier 的 modifier 配置或调用方需要停止写入该输入;`Smooth Weight` 只在没有其他消费者的节点组中移除。
|
||||
@@ -0,0 +1,34 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: 主节点组不得执行末端整体 mesh smooth
|
||||
系统 SHALL 让 `O Image Cutout`、`O Image Depth Cutout`、`O Image Depth Plane`、`O Image Depth Panorama` 与 `O Image Relief Plane` 在主体几何构建完成后直接进入着色或输出阶段,不得追加由通用 `Smooth` 控制的整体顶点位置平滑。
|
||||
|
||||
#### Scenario: 节点组接口不再提供整体 smooth
|
||||
- **WHEN** 检查任一受影响节点组的公开输入接口
|
||||
- **THEN** 该接口不包含 `Smooth`
|
||||
|
||||
#### Scenario: 输出路径不经过整体 smooth
|
||||
- **WHEN** 构建任一受影响节点组并追踪其最终业务几何到输出的连接
|
||||
- **THEN** 输出路径不包含原先由 `Smooth` 和 `Smooth Weight` 控制的整体 `expand_smooth()` 后处理
|
||||
|
||||
### Requirement: Smooth Weight 按独立消费者保留
|
||||
系统 MUST 在 `Smooth Weight` 仍控制 `Boundary Smooth` 时保留该输入,并在它仅服务已删除的整体 smooth 时删除该输入。
|
||||
|
||||
#### Scenario: 深度节点组保留共享权重
|
||||
- **WHEN** 检查 `O Image Depth Cutout`、`O Image Depth Plane` 或 `O Image Depth Panorama`
|
||||
- **THEN** 节点组仍提供 `Smooth Weight`,且该值继续参与边界平滑计算
|
||||
|
||||
#### Scenario: 无独立消费者的权重被删除
|
||||
- **WHEN** 检查 `O Image Cutout` 或 `O Image Relief Plane`
|
||||
- **THEN** 节点组接口不包含 `Smooth Weight`
|
||||
|
||||
### Requirement: 专用平滑行为保持可用
|
||||
系统 SHALL 保留与末端整体 mesh smooth 不同职责的边界平滑、法线平滑、填充墙体平滑和 smooth shading。
|
||||
|
||||
#### Scenario: 深度边界和法线控制仍存在
|
||||
- **WHEN** 检查受影响深度节点组的接口与计算路径
|
||||
- **THEN** 既有 `Boundary Smooth` 与适用的 `Normal Smooth` 仍按原职责工作
|
||||
|
||||
#### Scenario: 填充与着色平滑不受影响
|
||||
- **WHEN** 构建相关节点组并检查输出
|
||||
- **THEN** `Fill Smooth` 仍仅用于生成墙体内部,且既有 smooth shading 仍应用于对应表面
|
||||
17
openspec/changes/remove-geometry-node-smoothing/tasks.md
Normal file
17
openspec/changes/remove-geometry-node-smoothing/tasks.md
Normal file
@@ -0,0 +1,17 @@
|
||||
## 1. 节点组实现
|
||||
|
||||
- [x] 1.1 从 Cutout、Depth Cutout、Depth Plane、Depth Panorama 与 Relief Plane 删除 `Smooth` 接口及末端整体 `expand_smooth()` 调用,直接连接原有着色或输出阶段
|
||||
- [x] 1.2 从 Cutout 与 Relief Plane 删除仅服务整体 smooth 的 `Smooth Weight`,并确认三个深度节点组继续以 `Smooth Weight` 驱动边界平滑
|
||||
- [x] 1.3 检查共享 smoothing 构建函数的剩余调用,保留边界平滑所需实现并清理仅随末端整体 smooth 产生的无用代码
|
||||
|
||||
## 2. 调用方与测试
|
||||
|
||||
- [x] 2.1 清理 operator、节点检查工具和测试中对已删除 `Smooth` 及相应 `Smooth Weight` 的赋值与接口预期
|
||||
- [x] 2.2 更新节点组库存与布局测试,验证五个节点组不再暴露 `Smooth`,且仅三个深度节点组保留 `Smooth Weight`
|
||||
- [x] 2.3 精简整体 smooth 行为测试,并保留或补充边界平滑、法线平滑、Fill Smooth 与 smooth shading 不变的有效覆盖
|
||||
|
||||
## 3. 资产与验证
|
||||
|
||||
- [x] 3.1 同步 `tools/nodes` 与 `docs/internals` 中相关接口和实现说明,检查仓库内不存在失效的整体 `Smooth` 引用
|
||||
- [x] 3.2 运行 `uv run node-group build`,更新并验证 `src/anyimage/assets/O_AnyImage.blend`
|
||||
- [x] 3.3 运行相关节点与 operator 测试,检查最终差异并确认专用平滑路径仍正常
|
||||
Reference in New Issue
Block a user