@@ -26,6 +26,7 @@ export type LineUniformsType = {
2626 [ 'u_alpha_discard_threshold' ] : Uniform1f ;
2727 [ 'u_trim_offset' ] : Uniform2f ;
2828 [ 'u_trim_fade_range' ] : Uniform2f ;
29+ [ 'u_trim_gradient_mix_range' ] : Uniform2f ;
2930 [ 'u_trim_color' ] : Uniform4f ;
3031 [ 'u_zbias_factor' ] : Uniform1f ;
3132 [ 'u_tile_to_meter' ] : Uniform1f ;
@@ -45,6 +46,7 @@ export type LinePatternUniformsType = {
4546 [ 'u_alpha_discard_threshold' ] : Uniform1f ;
4647 [ 'u_trim_offset' ] : Uniform2f ;
4748 [ 'u_trim_fade_range' ] : Uniform2f ;
49+ [ 'u_trim_gradient_mix_range' ] : Uniform2f ;
4850 [ 'u_trim_color' ] : Uniform4f ;
4951 [ 'u_zbias_factor' ] : Uniform1f ;
5052 [ 'u_tile_to_meter' ] : Uniform1f ;
@@ -69,6 +71,7 @@ const lineUniforms = (context: Context): LineUniformsType => ({
6971 'u_alpha_discard_threshold' : new Uniform1f ( context ) ,
7072 'u_trim_offset' : new Uniform2f ( context ) ,
7173 'u_trim_fade_range' : new Uniform2f ( context ) ,
74+ 'u_trim_gradient_mix_range' : new Uniform2f ( context ) ,
7275 'u_trim_color' : new Uniform4f ( context ) ,
7376 'u_zbias_factor' : new Uniform1f ( context ) ,
7477 'u_tile_to_meter' : new Uniform1f ( context ) ,
@@ -88,6 +91,7 @@ const linePatternUniforms = (context: Context): LinePatternUniformsType => ({
8891 'u_alpha_discard_threshold' : new Uniform1f ( context ) ,
8992 'u_trim_offset' : new Uniform2f ( context ) ,
9093 'u_trim_fade_range' : new Uniform2f ( context ) ,
94+ 'u_trim_gradient_mix_range' : new Uniform2f ( context ) ,
9195 'u_trim_color' : new Uniform4f ( context ) ,
9296 'u_zbias_factor' : new Uniform1f ( context ) ,
9397 'u_tile_to_meter' : new Uniform1f ( context ) ,
@@ -134,6 +138,7 @@ const lineUniformValues = (
134138 'u_alpha_discard_threshold' : 0.0 ,
135139 'u_trim_offset' : trimOffset ,
136140 'u_trim_fade_range' : layer . paint . get ( 'line-trim-fade-range' ) ,
141+ 'u_trim_gradient_mix_range' : [ 1.0 , 1.0 ] ,
137142 'u_trim_color' : layer . paint . get ( 'line-trim-color' ) . toPremultipliedRenderColor ( ignoreLut ? null : layer . lut ) . toArray01 ( ) ,
138143 'u_zbias_factor' : zbiasFactor ,
139144 'u_tile_to_meter' : tileToMeter ( tile . tileID . canonical , 0.0 ) ,
@@ -176,6 +181,7 @@ const linePatternUniformValues = (
176181 'u_alpha_discard_threshold' : 0.0 ,
177182 'u_trim_offset' : trimOffset ,
178183 'u_trim_fade_range' : layer . paint . get ( 'line-trim-fade-range' ) ,
184+ 'u_trim_gradient_mix_range' : [ 1.0 , 1.0 ] ,
179185 'u_trim_color' : layer . paint . get ( 'line-trim-color' ) . toPremultipliedRenderColor ( ignoreLut ? null : layer . lut ) . toArray01 ( ) ,
180186 'u_zbias_factor' : zbiasFactor ,
181187 'u_tile_to_meter' : tileToMeter ( tile . tileID . canonical , 0.0 ) ,
0 commit comments