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
10fn class_to_rgb(
11 visualization: f32,
12 sh_color: vec3<f32>,
13) -> vec3<f32> {
14 if visualization < 2.0 {
15 return sh_color;
16 }
18 let class_idx = visualization - 2.0;
19 let hue = (class_idx / f32(gaussian_uniforms.num_classes)) * 6.283185307;
21 return mix(
22 sh_color,
23 hsv_to_rgb(
24 vec3<f32>(hue, 1.0, 1.0)
25 ),
26 0.5
27 );
Contents