- Implemented a preview tool for rectifying images with interactive aspect controls in `preview.py`. - Added tests for depth metadata loading to ensure consistent schema usage in `test_depth_metadata.py`. - Developed comprehensive tests for cutout calibration processes in `test_cutout_calibration.py`, including stability checks and depth calibration. - Created tests for frame compositing operations in `test_frame_compositing.py`, ensuring correct handling of depth and transparency. - Introduced material slot inheritance functionality in `material_slots.py` to manage geometry material assignments. - Built shared shader nodes for material processing in `shader.py`, including roughness and bump mapping setups.
41 lines
2.1 KiB
Markdown
41 lines
2.1 KiB
Markdown
# Job 产物
|
||
|
||
Server 将结果写入 Job 目录,返回以相对文件名为值的字典。Blender 主线程通过 JobResult 读取文件,创建或更新 Image、Mesh、Material 和 Object。
|
||
|
||
| Job | 文件 | 消费方 |
|
||
| --- | --- | --- |
|
||
| `remove-background` | PNG 序列或 `alpha.npy` | ImageEditTarget 或 HDR Alpha 编辑 |
|
||
| `upscale-image` | `upscale.0001.png` 起 | 图像替换 |
|
||
| `generate-depth-plane-geometry` | `depth.exr`、`depth.json` 和法线 | Depth / Relief Plane |
|
||
| `generate-cutout-artifacts` | 按请求提供深度、元数据和法线 | Cutout |
|
||
| `generate-panorama-geometry` | `depth.exr`、`depth.json` | Panorama |
|
||
|
||
## 深度与法线协议
|
||
|
||
| 返回字段 | 内容 |
|
||
| --- | --- |
|
||
| `depth` | float32 EXR,透视产物 RGB 保存相机空间 XYZ,Alpha 保存源 Alpha × 模型有效性 |
|
||
| `depth_metadata` | JSON,透视产物包含 `image_size`、3×3 `intrinsics`、`reference_depth` |
|
||
| `tangent_normal` | `tangent-normal.png`,切线空间法线 |
|
||
| `object_normal` | `object-normal.png`,对象空间法线 |
|
||
|
||
```mermaid
|
||
flowchart TD
|
||
A[源 RGB 与 Alpha] --> B[限尺寸 RGB 推理]
|
||
B --> C[GeometryFrame]
|
||
C --> D[写出深度与法线]
|
||
A --> E[Alpha 有效性与参考区域]
|
||
E --> D
|
||
D --> F[Blender 加载并 Pack]
|
||
```
|
||
|
||
参考深度取满足模型有效性、有限正深度与 Alpha 阈值的样本中位数。`common/depth.py` 加载 EXR,设置 Non-Color 和 CHANNEL_PACKED。Depth Plane 使用对象空间法线,Relief Plane 使用切线空间法线。
|
||
|
||
Panorama 的 EXR RGB 保存径向距离,Alpha 保存源 Alpha 与融合有效性;元数据包含 `projection: equirectangular` 和 `image_size`。
|
||
|
||
## 颜色与图像编辑
|
||
|
||
`common/color_image.py` 为 Plane、Panorama 和 Cutout 准备独立的材质颜色与 AI 分析输入。Cutout 使用 Selection bounds 内的源图;网格创建时组合源 Alpha 与 SelectionMask。颜色分辨率与分析尺寸分别处理。
|
||
|
||
`ImageEditTarget` 统一 Image Empty 和 Shader Image Texture 的编辑目标及共享引用。HDR 去背景通过 `HdrBackgroundInput` 保留 Blender 浮点 RGB,并应用 Server 返回的连续 Alpha。
|