@@ -11,7 +11,7 @@ struct View {
11
11
};
12
12
13
13
struct PointLight {
14
- // NOTE: .z.z .z.w .w.z .w.w
14
+ // NOTE: [2][2] [2][3] [3][2] [3][3]
15
15
projection_lr : vec4 <f32 >;
16
16
color_inverse_square_range : vec4 <f32 >;
17
17
position_radius : vec4 <f32 >;
@@ -40,10 +40,12 @@ struct Lights {
40
40
// NOTE: this array size must be kept in sync with the constants defined bevy_pbr2/src/render/light.rs
41
41
directional_lights : array <DirectionalLight , 1u >;
42
42
ambient_color : vec4 <f32 >;
43
- cluster_dimensions : vec4 <u32 >; // x/y/z dimensions
44
- cluster_factors : vec4 <f32 >; // xy are vec2<f32>(cluster_dimensions.xy) / vec2<f32>(view.width, view.height)
45
- // z is cluster_dimensions.z / log(far / near)
46
- // w is cluster_dimensions.z * log(near) / log(far / near)
43
+ // x/y/z dimensions
44
+ cluster_dimensions : vec4 <u32 >;
45
+ // xy are vec2<f32>(cluster_dimensions.xy) / vec2<f32>(view.width, view.height)
46
+ // z is cluster_dimensions.z / log(far / near)
47
+ // w is cluster_dimensions.z * log(near) / log(far / near)
48
+ cluster_factors : vec4 <f32 >;
47
49
n_directional_lights : u32 ;
48
50
};
49
51
@@ -54,13 +56,15 @@ struct PointLights {
54
56
55
57
[[block ]]
56
58
struct ClusterLightIndexLists {
57
- data : array <vec4 <u32 >, 1024u >; // each u32 contains 4 u8 indices into the PointLights array
59
+ // each u32 contains 4 u8 indices into the PointLights array
60
+ data : array <vec4 <u32 >, 1024u >;
58
61
};
59
62
60
63
[[block ]]
61
64
struct ClusterOffsetsAndCounts {
62
- data : array <vec4 <u32 >, 1024u >; // each u32 contains a 24-bit index into ClusterLightIndexLists in the high 24 bits
63
- // and an 8-bit count of the number of lights in the low 8 bits
65
+ // each u32 contains a 24-bit index into ClusterLightIndexLists in the high 24 bits
66
+ // and an 8-bit count of the number of lights in the low 8 bits
67
+ data : array <vec4 <u32 >, 1024u >;
64
68
};
65
69
66
70
[[group (0 ), binding (0 )]]
0 commit comments