Implement appearance baking pipeline (#66)
Some checks failed
Native code generation / deterministic (push) Failing after 2m18s
Imaging and meshing gate / native (push) Failing after 1m28s
Native Rust workspace compile / compile (push) Failing after 58s

This commit is contained in:
2026-08-10 10:33:29 +00:00
parent a9927fcfcb
commit b1f60db3d6
17 changed files with 3487 additions and 249 deletions

View File

@@ -35,7 +35,12 @@ fn bake_grayscale_layer_texture_does_not_throw() {
let mut baker = imaging::Baker::new(BakeType::UpperBody).unwrap();
baker.add_texture(data).unwrap();
baker.bake().unwrap();
assert!(baker.baked_texture().is_some());
let baked = baker.baked_texture().unwrap();
let image = baked.image.unwrap();
assert_eq!((image.width, image.height), (1024, 1024));
assert_eq!((image.red[0], image.green[0], image.blue[0]), (63, 31, 94));
assert_eq!(image.alpha[0], 255);
assert_eq!(image.bump[0], 0);
}
// parity-case: LibreMetaverse.Tests/BakerTests.cs::BakerTests.Bake_GrayscaleHairTextureNoSkin_DoesNotThrow::test e48b737d9138e63cda98b5e80bf561a80d1dab5de78901ac9e1bb320ca281eb6 translated
@@ -97,3 +102,19 @@ fn resize_to_bake_dimensions_source_smaller_in_one_axis_only_scales_rather_than_
assert_eq!(result.height, 4);
assert!(result.red[3 * 4] > 50);
}
#[test]
fn bake_type_for_preserves_the_reference_base_layer_mapping() {
assert_eq!(
imaging::Baker::bake_type_for(AvatarTextureIndex::UpperShirt).unwrap(),
BakeType::UpperBody
);
assert_eq!(
imaging::Baker::bake_type_for(AvatarTextureIndex::UpperTattoo).unwrap(),
BakeType::Unknown
);
assert_eq!(
imaging::Baker::bake_type_for(AvatarTextureIndex::Aux1Tattoo).unwrap(),
BakeType::Unknown
);
}