1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! Configuration options for polyscope.
use glam::Vec4;
use serde::{Deserialize, Serialize};
use crate::SsaoConfig;
/// Global configuration options for polyscope.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Options {
/// Whether to automatically compute scene extents.
pub auto_compute_scene_extents: bool,
/// Whether to invoke user callback during rendering.
pub invoke_user_callback_for_nested_show: bool,
/// Whether to give focus to the polyscope window.
pub give_focus_on_show: bool,
/// Whether the ground plane is enabled.
pub ground_plane_enabled: bool,
/// Ground plane mode (shadow, tile, etc.).
pub ground_plane_mode: GroundPlaneMode,
/// Ground plane height (world coordinates).
pub ground_plane_height: f32,
/// Background color.
pub background_color: Vec4,
/// Whether to enable transparency.
pub transparency_enabled: bool,
/// Transparency mode.
pub transparency_mode: TransparencyMode,
/// Number of render passes for depth-peeling transparency (Pretty mode).
pub transparency_render_passes: u32,
/// SSAA (supersampling) factor.
pub ssaa_factor: u32,
/// Maximum frames per second (0 = unlimited).
pub max_fps: u32,
/// SSAO configuration.
pub ssao: SsaoConfig,
}
impl Default for Options {
fn default() -> Self {
Self {
auto_compute_scene_extents: true,
invoke_user_callback_for_nested_show: false,
give_focus_on_show: true,
ground_plane_enabled: true,
ground_plane_mode: GroundPlaneMode::ShadowOnly,
ground_plane_height: 0.0,
background_color: Vec4::new(1.0, 1.0, 1.0, 1.0),
transparency_enabled: true,
transparency_mode: TransparencyMode::Simple,
transparency_render_passes: 8,
ssaa_factor: 1,
max_fps: 60,
ssao: SsaoConfig::default(),
}
}
}
/// Mode for the ground plane rendering.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum GroundPlaneMode {
/// No ground plane.
None,
/// Ground plane with shadow only.
#[default]
ShadowOnly,
/// Ground plane with tile pattern.
Tile,
/// Ground plane with solid color.
SolidColor,
}
/// Mode for transparency rendering.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
pub enum TransparencyMode {
/// Simple transparency (order-dependent, default).
#[default]
Simple,
/// Depth-peeled transparency - correct front-to-back ordering via multiple passes.
Pretty,
/// No transparency.
None,
}