Render: integrated workspace, preview image jobs and opaque PBR (#1046)
Lands the Render workspace (R3), bounded preview-image jobs with cancellation and atomic PNG export (R4a), and opaque PBR looks as one change. - Render workspace: an overlay-free product preview on the installed GPU device. Returning to Design restores its camera. render.scene and render.settings.apply are added. - Image jobs: render.preflight/start/status/cancel/export run bounded CPU preview jobs. Export captures the job, overwrite choice and document, and checks the caller's file scope before writing. - Opaque PBR: looks can carry metal fraction, roughness and dielectric IOR. The product viewport and preview PNG use them; geometry and mass are unchanged. The v1 catalog export refuses PBR rather than dropping it. - Render setups and PBR looks are saved under design format 21. Labels are in en/de/ja/ko/zh/ru. Supersedes #706 and #800. Refs #620, #673, #756, #1004. Contributed by @0xlillith. Co-authored-by: lillith <35337584+0xlillith@users.noreply.github.com>
This commit is contained in:
1 parent
e4ef6cfe29
commit
a261aaa841
70 files changed
+5860
-101
No files matched your search
@@ -123,3 +123,34 @@ fn design_export_deduplicates_exact_looks_and_keeps_physical_properties_distinct
|
||||
assert_eq!(library, Catalog::decode(&library.encode().unwrap()).unwrap());
|
||||
assert!(Catalog::from_document(&Document::default(), "user.test", "Test", Provenance { license: String::new(), ..Default::default() }).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scalar_export_refuses_pbr_in_every_design_owned_appearance_location() {
|
||||
use solidcraft_doc::{appearance::FaceLook, pbr_appearance::PbrParameters};
|
||||
let mut look = ScalarLook { name: "Original PBR specimen".into(), color: [180, 120, 70], opacity: 1.0 }.to_look();
|
||||
look.pbr = Some(PbrParameters::new(1.0, 0.3, 1.5).unwrap());
|
||||
for location in 0..4 {
|
||||
let mut doc = Document::default();
|
||||
match location {
|
||||
0 => {
|
||||
doc.appearances.bodies.insert("Specimen".into(), look.clone());
|
||||
}
|
||||
1 => {
|
||||
doc.appearances.components.insert(1, look.clone());
|
||||
}
|
||||
2 => doc.appearances.faces.push(FaceLook {
|
||||
body: "Specimen".into(),
|
||||
point: Default::default(),
|
||||
look: look.clone(),
|
||||
name: None,
|
||||
strict_name: false,
|
||||
certificate: None,
|
||||
}),
|
||||
_ => doc.user_materials.push(UserMaterial { name: "Original material".into(), density: 1.2, appearance: Some(look.clone()) }),
|
||||
}
|
||||
let before = doc.clone();
|
||||
let error = Catalog::from_document(&doc, "user.test", "Test", Provenance::default()).unwrap_err();
|
||||
assert!(error.to_string().contains("cannot preserve PBR"));
|
||||
assert_eq!(doc, before);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user