Repository navigation
feat(cli,core,lang,wasm): add translucent/emissive materials, non-GLB --scene exports, and CLI multi-part ergonomics - #138
Merged
Conversation
… --scene exports, and CLI multi-part ergonomics
…ucency-srgb # Conflicts: # crates/forma-core/src/export.rs # crates/forma-core/src/render.rs # crates/forma-lang/src/lib.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses real-world CLI evaluation feedback where agents using Forma via CLI (with
SKILL.md,forma spec, andforma --helponly) struggled to discover multi-part scene export, attempted expensive boolean unions across architectural scenes, and could not express translucent/emissive materials (e.g., steam, water, glowing shoji/lanterns).1. CLI Multi-Part Export Ergonomics & Parity
--help(KEY OPTIONS:&EXAMPLES:): Both nativeforma(crates/forma-cli/src/main.rs) and WASMforma-3d(bin/forma.mjs) now explicitly explain--scenevs single-part default export and listforma spec --topic.NOTE:when--sceneis omitted on multi-part scenes: Running--out/--render/--drawwithout--sceneon a scene withparts > 1now emits an actionableNOTE:on stderr (keeping--jsonstdout strictly valid JSON).--critique,--raw-box, andlintsubcommand support tobin/forma.mjs.SPEC_PIPE,spec_topic("scene"),SKILL.md(explicit CLI--scenecomments, workflow guidance, and CLIforma spec --topiclisting),AGENTS.md,docs/reference/cli.md, anddocs/reference/language-and-formats.md.2. Translucency, Emissive, Transmission, IOR & Dielectric Color Consistency
Forma-Pipesyntax (mat(...)/color(...)):alpha=/opacity=/a=and 4-tuple RGBAcolor=(r, g, b, a).emissive=(r, g, b),emissive_strength=,transmission=,ior=, anddouble_sided=.metallicfrom0.1→0.0so non-metals (wood, plaster, foliage, stone, steam) default to physically accurate dielectrics..glbexport & round-trip import (export.rs,import.rs):build_gltf_materialacross single-mesh and multi-node--sceneGLB exports."alphaMode": "BLEND"wheneveralpha < 1.0,"doubleSided": true, sRGB→linear"emissiveFactor"(matching existing sRGB→linearbaseColorFactor), and KHR extensions (KHR_materials_transmission,KHR_materials_ior,KHR_materials_emissive_strength) with root"extensionsUsed"..glbimport (read_glb_bytes).render.rs):raster_tri_blend) tested against opaque depth without Z-write, transmissive preview opacity, emissive glow, anddouble_sidedshading.3. Non-GLB Multi-Part
--sceneExportwrite_scene_obj_bytes(multi-objecto <name>groups),write_scene_3mf_bytes_with_unit(multi-<object>3MF),write_scene_step_bytes_with_unit(multi-solid STEP), and combined.stlscene export viaScene::export_scene_bytesandScene::export_scene_path.forma_session_export_scene_formatinforma-wasmand updatedlib/edge.mjs,lib/index.d.ts,bin/forma.mjs,bin/forma-mcp.mjs, and rebuiltwasm/forma.wasm.Verification
cargo test -p forma-cli --test scene_materials_cli -p forma-core --test kernel_tests -p forma-lang --test validation --release— 37/37 passed (including new tests for sRGB/linear + translucency/emissive/transmission/IOR GLB round-trips, multi-part OBJ/3MF/STL/STEP--sceneexports, and native CLI--scene/ missing---sceneNOTE:).cargo check --workspace --tests— clean across all 7 workspace crates.npm run build:wasm && npm test— rebuiltwasm/forma.wasmand passed 5/5 smoke suites (ESM, Edge/Workers, WASM CLI--scene+ non-GLB + stderrNOTE:, all 5SKILL.mdrecipes, and MCP stdio server).python3 scripts/check_local_paths.py— clean across all tracked files.