Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#define_import_path bevy_gaussian_splatting::classification
3#import bevy_render::color_operations::{
4 hsv_to_rgb,
5 rgb_to_hsv,
6}
7#import bevy_gaussian_splatting::bindings::gaussian_uniforms
9fn class_to_rgb(
10 visualization: f32,
11 sh_color: vec3<f32>,
12) -> vec3<f32> {
13 if visualization < 2.0 {
14 return sh_color;
15 }
17 let class_idx = visualization - 2.0;
18 let hue = (class_idx / f32(gaussian_uniforms.num_classes)) * 6.283185307;
20 return mix(
21 sh_color,
22 hsv_to_rgb(
23 vec3<f32>(hue, 1.0, 1.0)
24 ),
25 0.5
26 );
Contents