mirror of
https://github.com/storytold/texturecraft.git
synced 2026-11-24 00:10:45 +01:00
Pick the display tone mapping from a dropdown
The AO intensity is set in Shader Settings, so Display Settings no longer repeats it.
This commit is contained in:
1 parent
63fc993644
commit
f5d07ced6b
11 files changed
+38
-14
No files matched your search
@@ -60,7 +60,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "دائماً"),
|
||||
("Ambient Occlusion", "الانسداد المحيطي (AO)"),
|
||||
("Ambient occlusion", "الانسداد المحيطي (AO)"),
|
||||
("Ambient occlusion intensity", "شدة الانسداد المحيطي"),
|
||||
("Amount", "المقدار"),
|
||||
("Anchor point", "نقطة ارتكاز"),
|
||||
("Anchor: {name}", "نقطة ارتكاز: {name}"),
|
||||
|
||||
@@ -63,7 +63,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "Immer"),
|
||||
("Ambient Occlusion", "Ambient Occlusion"),
|
||||
("Ambient occlusion", "Ambient occlusion"),
|
||||
("Ambient occlusion intensity", "Ambient-Occlusion-Intensität"),
|
||||
("Amount", "Stärke"),
|
||||
("Anchor point", "Ankerpunkt"),
|
||||
("Anchor: {name}", "Anker: {name}"),
|
||||
|
||||
@@ -60,7 +60,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "Siempre"),
|
||||
("Ambient Occlusion", "Oclusión ambiental"),
|
||||
("Ambient occlusion", "Oclusión ambiental"),
|
||||
("Ambient occlusion intensity", "Intensidad de la oclusión ambiental"),
|
||||
("Amount", "Cantidad"),
|
||||
("Anchor point", "Punto de anclaje"),
|
||||
("Anchor: {name}", "Anclaje: {name}"),
|
||||
|
||||
@@ -66,7 +66,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "Toujours"),
|
||||
("Ambient Occlusion", "Occlusion ambiante"),
|
||||
("Ambient occlusion", "Occlusion ambiante"),
|
||||
("Ambient occlusion intensity", "Intensité de l'occlusion ambiante"),
|
||||
("Amount", "Quantité"),
|
||||
("Anchor point", "Point d'ancrage"),
|
||||
("Anchor: {name}", "Ancrage : {name}"),
|
||||
|
||||
@@ -63,7 +63,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "Sempre"),
|
||||
("Ambient Occlusion", "Occlusione ambientale"),
|
||||
("Ambient occlusion", "Occlusione ambientale"),
|
||||
("Ambient occlusion intensity", "Intensità occlusione ambientale"),
|
||||
("Amount", "Quantità"),
|
||||
("Anchor point", "Punto di ancoraggio"),
|
||||
("Anchor: {name}", "Ancoraggio: {name}"),
|
||||
|
||||
@@ -66,7 +66,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "常に"),
|
||||
("Ambient Occlusion", "アンビエントオクルージョン"),
|
||||
("Ambient occlusion", "アンビエントオクルージョン"),
|
||||
("Ambient occlusion intensity", "アンビエントオクルージョンの強度"),
|
||||
("Amount", "量"),
|
||||
("Anchor point", "アンカーポイント"),
|
||||
("Anchor: {name}", "アンカー: {name}"),
|
||||
|
||||
@@ -63,7 +63,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "항상"),
|
||||
("Ambient Occlusion", "앰비언트 오클루전"),
|
||||
("Ambient occlusion", "앰비언트 오클루전"),
|
||||
("Ambient occlusion intensity", "앰비언트 오클루전 강도"),
|
||||
("Amount", "양"),
|
||||
("Anchor point", "앵커 포인트"),
|
||||
("Anchor: {name}", "앵커: {name}"),
|
||||
|
||||
@@ -63,7 +63,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "Sempre"),
|
||||
("Ambient Occlusion", "Oclusão de ambiente"),
|
||||
("Ambient occlusion", "Oclusão de ambiente"),
|
||||
("Ambient occlusion intensity", "Intensidade da oclusão de ambiente"),
|
||||
("Amount", "Quantidade"),
|
||||
("Anchor point", "Ponto de ancoragem"),
|
||||
("Anchor: {name}", "Âncora: {name}"),
|
||||
|
||||
@@ -54,7 +54,6 @@ pub const TABLE: &[(&str, &str)] = &[
|
||||
("Always", "始终"),
|
||||
("Ambient Occlusion", "环境光遮蔽"),
|
||||
("Ambient occlusion", "环境光遮蔽"),
|
||||
("Ambient occlusion intensity", "环境光遮蔽强度"),
|
||||
("Amount", "数量"),
|
||||
("Anchor point", "锚点"),
|
||||
("Anchor: {name}", "锚点:{name}"),
|
||||
|
||||
@@ -156,10 +156,14 @@ pub(crate) fn display(app: &mut TextureCraftApp, ui: &mut Ui) {
|
||||
if ui.checkbox(&mut ortho, tr("Orthographic")).changed() {
|
||||
app.run("camera.set", json!({"ortho": ortho}));
|
||||
}
|
||||
ui.horizontal(|ui| {
|
||||
ui.label(tr("Tone mapping"));
|
||||
ui.selectable_value(&mut d.tone_mapping, ToneMapping::Linear, tr("Linear"));
|
||||
ui.selectable_value(&mut d.tone_mapping, ToneMapping::AcesFilmic, tr("ACES filmic"));
|
||||
let tone_mapping_name = |tone_mapping: ToneMapping| match tone_mapping {
|
||||
ToneMapping::Linear => tr("Linear"),
|
||||
ToneMapping::AcesFilmic => tr("ACES filmic"),
|
||||
};
|
||||
combo(ui, tr("Tone mapping"), tone_mapping_name(d.tone_mapping), |ui| {
|
||||
for tone_mapping in [ToneMapping::Linear, ToneMapping::AcesFilmic] {
|
||||
ui.selectable_value(&mut d.tone_mapping, tone_mapping, tone_mapping_name(tone_mapping));
|
||||
}
|
||||
});
|
||||
cameras(app, ui);
|
||||
ui.add_space(6.0);
|
||||
@@ -177,7 +181,6 @@ pub(crate) fn display(app: &mut TextureCraftApp, ui: &mut Ui) {
|
||||
});
|
||||
ui.add_space(6.0);
|
||||
ui.label(caption(tr("Viewer settings")));
|
||||
slider(ui, tr("Ambient occlusion intensity"), &mut d.ao_intensity, 0.0..=1.0, 2);
|
||||
ui.checkbox(&mut app.ui.wireframe_3d, tr("Show wireframe in the 3D view"));
|
||||
ui.checkbox(&mut app.ui.uv_wireframe, tr("Show UV wireframe in the 2D view"));
|
||||
ui.checkbox(&mut d.taa, tr("Temporal anti-aliasing (refines the 3D view while it is still)"));
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//! Display Settings picks its tone mapping from a dropdown and leaves the AO intensity to Shader Settings
|
||||
|
||||
use egui::Role;
|
||||
use egui_kittest::Harness;
|
||||
use egui_kittest::kittest::{NodeT, Queryable};
|
||||
use texturecraft_ui_egui::TextureCraftApp;
|
||||
use texturecraft_ui_egui::docking::Panel;
|
||||
|
||||
const WINDOW_SIZE: egui::Vec2 = egui::vec2(1600.0, 960.0);
|
||||
|
||||
/// Small texture and bake sizes keep the sample session fast; the panel doesn't depend on them
|
||||
const TEXTURE_RESOLUTION: u32 = 256;
|
||||
const BAKE_RESOLUTION: u32 = 64;
|
||||
|
||||
/// Frames for the first layout and fonts to settle
|
||||
const STARTUP_FRAMES: usize = 4;
|
||||
|
||||
#[test]
|
||||
fn display_picks_the_tone_mapping_from_a_dropdown() {
|
||||
let session = texturecraft_engine::sample_session(TEXTURE_RESOLUTION, BAKE_RESOLUTION).unwrap();
|
||||
let mut harness = Harness::builder().with_size(WINDOW_SIZE).build_eframe(|cc| TextureCraftApp::new(cc, session));
|
||||
// The labels below are English; a first run would speak the system's language
|
||||
harness.state_mut().ui.prefs.language = "en".into();
|
||||
harness.state_mut().ui.dock.focus(Panel::Display);
|
||||
harness.run_steps(STARTUP_FRAMES);
|
||||
|
||||
let tone_mapping = harness.get_all_by_role(Role::ComboBox).find(|combo| combo.accesskit_node().value().as_deref() == Some("ACES filmic"));
|
||||
assert!(tone_mapping.is_some(), "the tone mapping is a dropdown showing ACES filmic");
|
||||
assert!(harness.query_by_label("Ambient occlusion intensity").is_none(), "the AO intensity is in Shader Settings");
|
||||
}
|
||||
Reference in new issue
Block a user