File tree 2 files changed +6
-3
lines changed
crates/bevy_pbr/src/render
2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -84,11 +84,12 @@ fn cluster_debug_visualization(
84
84
if (z_slice & 1u ) == 1u {
85
85
z_slice = z_slice + bindings ::lights . cluster_dimensions. z / 2u ;
86
86
}
87
- let slice_color = hsv_to_rgb (
87
+ let slice_color_hsv = vec3 (
88
88
f32 (z_slice ) / f32 (bindings ::lights . cluster_dimensions. z + 1u ) * PI_2,
89
89
1.0 ,
90
90
0.5
91
91
);
92
+ let slice_color = hsv_to_rgb (slice_color_hsv );
92
93
output_color = vec4 <f32 >(
93
94
(1.0 - cluster_overlay_alpha ) * output_color . rgb + cluster_overlay_alpha * slice_color ,
94
95
output_color . a
@@ -115,7 +116,8 @@ fn cluster_debug_visualization(
115
116
// NOTE: Visualizes the cluster to which the fragment belongs
116
117
let cluster_overlay_alpha = 0.1 ;
117
118
var rng = cluster_index ;
118
- let cluster_color = hsv_to_rgb (rand_f (& rng ) * PI_2, 1.0 , 0.5 );
119
+ let cluster_color_hsv = vec3 (rand_f (& rng ) * PI_2, 1.0 , 0.5 );
120
+ let cluster_color = hsv_to_rgb (cluster_color_hsv );
119
121
output_color = vec4 <f32 >(
120
122
(1.0 - cluster_overlay_alpha ) * output_color . rgb + cluster_overlay_alpha * cluster_color ,
121
123
output_color . a
Original file line number Diff line number Diff line change @@ -194,11 +194,12 @@ fn cascade_debug_visualization(
194
194
) -> vec3 <f32 > {
195
195
let overlay_alpha = 0.95 ;
196
196
let cascade_index = get_cascade_index (light_id , view_z );
197
- let cascade_color = hsv_to_rgb (
197
+ let cascade_color_hsv = vec3 (
198
198
f32 (cascade_index ) / f32 (#{MAX_CASCADES_PER_LIGHT}u + 1u ) * PI_2,
199
199
1.0 ,
200
200
0.5
201
201
);
202
+ let cascade_color = hsv_to_rgb (cascade_color_hsv );
202
203
return vec3 <f32 >(
203
204
(1.0 - overlay_alpha ) * output_color . rgb + overlay_alpha * cascade_color
204
205
);
You can’t perform that action at this time.
0 commit comments