feat: implement separate geometry handling for panorama mask regions

- Replace Delete Geometry with Separate Geometry in O Image Depth Panorama to manage low and high mask areas independently.
- Adjust depth processing to ensure low mask regions are displaced to Dome Radius while high mask regions follow existing depth rules.
- Update tests to validate new behavior, ensuring outputs align with expected results for both mask states.
- Enhance material handling by introducing emission strength in the shadeless group.
This commit is contained in:
2026-09-17 02:23:19 +08:00
parent efd117dd9b
commit ac7f5a7f6d
13 changed files with 391 additions and 42 deletions

Binary file not shown.

View File

@@ -80,6 +80,36 @@ def material_node_group(depth_plane=False):
return load_node_group(group_name)
def create_emission_material(
source_image,
color_image,
scene=None,
texture_extension="EXTEND",
):
"""Emit the color image unchanged, without alpha blending or lighting."""
preserve_color = color_image.is_float or not color_image.colorspace_settings.name.endswith("sRGB")
material_image = color_image if preserve_color else configure_material_color_image(color_image, scene)
if material_image.source == "GENERATED" or material_image.is_dirty:
material_image.pack()
material = bpy.data.materials.new(image_base_name(source_image))
material.use_nodes = True
nodes = material.node_tree.nodes
nodes.clear()
color_texture = nodes.new("ShaderNodeTexImage")
emission = nodes.new("ShaderNodeEmission")
output = nodes.new("ShaderNodeOutputMaterial")
color_texture.image = material_image
color_texture.interpolation = "Linear"
color_texture.extension = texture_extension
color_texture.location = (-700.0, 300.0)
emission.location = (-300.0, 300.0)
output.location = (100.0, 300.0)
links = material.node_tree.links
links.new(color_texture.outputs["Color"], emission.inputs["Color"])
links.new(emission.outputs["Emission"], output.inputs["Surface"])
return material
def create_image_material(
source_image,
color_image,

View File

@@ -8,7 +8,7 @@ import bpy
from ...common.depth import load_depth_result_image
from ...common.image import require_conversion_source
from ...common.color_image import material_color_image
from ...common.material import create_image_material
from ...common.material import create_emission_material
from ...common.node import load_node_group
from ...common.object import finalize_object_result, modifier_input_identifier, set_modifier_input
@@ -34,8 +34,8 @@ def create_panorama_from_result(context, result, operator):
metadata = load_panorama_metadata(result.file("depth_metadata"))
group = load_node_group("O Image Depth Panorama")
depth = load_depth_result_image(result.file("depth"), source, metadata)
material = create_image_material(source.data, color, shadeless=True, scene=context.scene,
texture_extension="REPEAT")
material = create_emission_material(source.data, color, scene=context.scene,
texture_extension="REPEAT")
mesh = bpy.data.meshes.new(source.name)
mesh.from_pydata([(0, 0, 0)], [], [])
mesh.materials.append(material)