22#include "_prelude_shadow.vertex.glsl"
33
44in vec3 a_pos_3f;
5- in vec3 a_normal_3;
6- in vec3 a_centroid_3;
7- in float a_flood_light_wall_radius_1i16;
5+ in ivec3 a_normal_3;
6+ in ivec3 a_centroid_3;
87
9- in vec4 a_faux_facade_data;
10- in vec2 a_faux_facade_vertical_range;
8+ #ifdef FLOOD_LIGHT
9+ in int a_flood_light_wall_radius_1i16;
10+ #endif
11+
12+ #ifdef BUILDING_FAUX_FACADE
13+ in uvec4 a_faux_facade_data;
14+ in uvec2 a_faux_facade_vertical_range;
15+ #endif
1116
1217uniform mat4 u_matrix;
1318uniform mat4 u_normal_matrix;
@@ -59,39 +64,40 @@ mat3 get_tbn(in vec3 normal) {
5964 return mat3 (tangent, bitangent, normal);
6065}
6166#endif
62- #pragma mapbox: define- attribute - vertex- shader- only highp vec2 part_color_emissive
63- #pragma mapbox: define- attribute - vertex- shader- only highp vec2 faux_facade_color_emissive
67+ #pragma mapbox: define- attribute - vertex- shader- only highp uvec2 part_color_emissive
68+ #pragma mapbox: define- attribute - vertex- shader- only highp uvec2 faux_facade_color_emissive
6469
6570void main() {
66- #pragma mapbox: initialize- attribute - custom highp vec2 part_color_emissive
67- #pragma mapbox: initialize- attribute - custom highp vec2 faux_facade_color_emissive
71+ #pragma mapbox: initialize- attribute - custom highp uvec2 part_color_emissive
72+ #pragma mapbox: initialize- attribute - custom highp uvec2 faux_facade_color_emissive
6873
6974#ifdef FLOOD_LIGHT
70- v_flood_radius = (a_flood_light_wall_radius_1i16 / MAX_INT_16 * FLOOD_LIGHT_MAX_RADIUS_METER);
75+ v_flood_radius = (float ( a_flood_light_wall_radius_1i16) / MAX_INT_16 * FLOOD_LIGHT_MAX_RADIUS_METER);
7176 v_has_flood_light = step (0.0 , v_flood_radius);
7277#endif
7378
74- vec4 color_emissive = decode_color(part_color_emissive);
79+ vec4 color_emissive = decode_color(vec2 ( part_color_emissive) );
7580 v_color = vec4 (sRGBToLinear(color_emissive.rgb), color_emissive.a);
7681
77- vec3 a_normal_3f = a_normal_3 / MAX_INT_16;
82+ vec3 a_normal_3f = vec3 ( a_normal_3) / MAX_INT_16;
7883 v_normal = vec3 (u_normal_matrix * vec4 (a_normal_3f, 0.0 ));
7984
8085 float hidden = 0.0 ;
8186 float depth_offset = 0.0 ;
8287#ifdef BUILDING_FAUX_FACADE
83- v_faux_facade = a_faux_facade_data.x;
88+ vec4 faux_facade_data = vec4 (a_faux_facade_data);
89+ v_faux_facade = faux_facade_data.x;
8490 if (v_faux_facade > 0.0 ) {
85- v_faux_facade_ed = a_faux_facade_data .x * u_tile_to_meter;
91+ v_faux_facade_ed = faux_facade_data .x * u_tile_to_meter;
8692
87- float window_x_perc = floor (a_faux_facade_data .y / TWO_POW_8);
88- float window_y_perc = a_faux_facade_data .y - TWO_POW_8 * window_x_perc;
93+ float window_x_perc = floor (faux_facade_data .y / TWO_POW_8);
94+ float window_y_perc = faux_facade_data .y - TWO_POW_8 * window_x_perc;
8995 vec2 window_perc = vec2 (window_x_perc, window_y_perc) / MAX_UINT_8;
9096
91- v_faux_facade_floor = (a_faux_facade_data .zw / MAX_UINT_16 * EXTENT) * u_tile_to_meter;
97+ v_faux_facade_floor = (faux_facade_data .zw / MAX_UINT_16 * EXTENT) * u_tile_to_meter;
9298 v_faux_facade_window = window_perc * v_faux_facade_floor;
9399
94- v_faux_facade_range = (a_faux_facade_vertical_range / MAX_UINT_16 * EXTENT) * u_tile_to_meter;
100+ v_faux_facade_range = (vec2 ( a_faux_facade_vertical_range) / MAX_UINT_16 * EXTENT) * u_tile_to_meter;
95101
96102 v_aspect = v_faux_facade_window.x / v_faux_facade_window.y;
97103
@@ -100,11 +106,10 @@ void main() {
100106 v_tbn_1 = tbn[1 ];
101107 v_tbn_2 = tbn[2 ];
102108
103- v_faux_color_emissive = decode_color(faux_facade_color_emissive);
109+ v_faux_color_emissive = decode_color(vec2 ( faux_facade_color_emissive) );
104110 v_faux_color_emissive.rgb = sRGBToLinear(v_faux_color_emissive.rgb);
105111
106- float height = a_centroid_3.z;
107- depth_offset = min (1000.0 , height) * 0.0000002 ;
112+ depth_offset = min (1000.0 , float (a_centroid_3.z)) * 0.0000002 ;
108113 }
109114#endif
110115 v_pos = a_pos_3f;
0 commit comments