feat: Add new Geometry Nodes groups for image relief and shadeless shader

- Implemented the "O Image Relief Plane" Geometry Nodes group to create a fixed-base image relief using depth images and various parameters.
- Created the "O Shadeless" shader node group to display color without scene lighting while preserving shadows and reflections.
- Introduced a preview feature for node groups, allowing for interactive visualization of node arrangements in an HTML format.
- Added a template HTML file for rendering node previews with customizable views and controls.
This commit is contained in:
2026-09-09 21:24:57 +08:00
parent f5aff50b13
commit 89087fc2e2
118 changed files with 5635 additions and 3130 deletions

View File

@@ -36,50 +36,52 @@ class ServerJobsTest(unittest.TestCase):
)
def test_depth_plane_job_requests_depth_texture_and_tangent_normal_together(self):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
input_path = root / "input.png"
input_path.touch()
context = FakeJobContext(root / "result", "generate-depth-plane-geometry")
depth_texture = context.directory / "depth.exr"
metadata = context.directory / "depth.json"
tangent_normal = context.directory / "tangent-normal.png"
parameters = {"input": str(input_path), "generate_depth": True}
with (
patch.object(
self.depth_plane_job,
"input_frames",
return_value=nullcontext([input_path]),
),
patch.object(self.depth_plane_job, "copy_color_images"),
patch.object(
self.depth_plane_job,
"generate_moge2_artifacts",
return_value={
"depth": depth_texture,
"depth_metadata": metadata,
"tangent_normal": tangent_normal,
},
) as generate,
):
result = self.depth_plane_job.run(context, parameters)
def test_plane_job_requests_depth_and_matching_normal_space(self):
for plane_type, normal_space in (("DEPTH", "OBJECT"), ("RELIEF", "TANGENT")):
normal_key = f"{normal_space.lower()}_normal"
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
input_path = root / "input.png"
input_path.touch()
context = FakeJobContext(root / "result", "generate-depth-plane-geometry")
depth_texture = context.directory / "depth.exr"
metadata = context.directory / "depth.json"
normal_texture = context.directory / f"{normal_space.lower()}-normal.png"
parameters = {"input": str(input_path), "plane_type": plane_type}
with (
patch.object(
self.depth_plane_job,
"input_frames",
return_value=nullcontext([input_path]),
),
patch.object(self.depth_plane_job, "copy_color_images"),
patch.object(
self.depth_plane_job,
"generate_moge2_artifacts",
return_value={
"depth": depth_texture,
"depth_metadata": metadata,
normal_key: normal_texture,
},
) as generate,
):
result = self.depth_plane_job.run(context, parameters)
self.assertEqual(
result,
{
"depth": "depth.exr",
"depth_metadata": "depth.json",
"tangent_normal": "tangent-normal.png",
},
)
generate.assert_called_once_with(
context,
parameters,
input_path,
generate_depth=True,
normal_mode="TANGENT",
)
self.assertEqual(
result,
{
"depth": "depth.exr",
"depth_metadata": "depth.json",
normal_key: f"{normal_space.lower()}-normal.png",
},
)
generate.assert_called_once_with(
context,
parameters,
input_path,
generate_depth=True,
normal_mode=normal_space,
)
def test_ben2_background_removal_writes_fast_transparent_png(self):