-
Notifications
You must be signed in to change notification settings - Fork 181
/
ssgi.rs
43 lines (39 loc) · 1.12 KB
/
ssgi.rs
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
use glam::Vec4;
#[derive(Clone, Copy)]
#[repr(C)]
pub struct SsgiConstants {
pub input_tex_size: Vec4,
pub output_tex_size: Vec4,
pub use_ao_only: u8,
pub ssgi_half_sample_count: u32,
pub max_kernel_radius_cs: f32,
pub use_kernel_distance_scaling: u8,
pub use_random_jitter: u8,
pub kernel_radius: f32,
}
impl SsgiConstants {
pub fn default_with_size(input_tex_size: Vec4, output_tex_size: Vec4) -> Self {
Self {
input_tex_size,
output_tex_size,
use_ao_only: 1,
ssgi_half_sample_count: 6,
max_kernel_radius_cs: 0.4,
use_kernel_distance_scaling: 0,
use_random_jitter: 0,
kernel_radius: 60.0,
}
}
pub fn insane_quality_with_size(input_tex_size: Vec4, output_tex_size: Vec4) -> Self {
Self {
input_tex_size,
output_tex_size,
use_ao_only: 0,
ssgi_half_sample_count: 32,
max_kernel_radius_cs: 100.0,
use_kernel_distance_scaling: 1,
use_random_jitter: 1,
kernel_radius: 5.0,
}
}
}