Compare commits

...

2 Commits

Author SHA1 Message Date
Antonio Scandurra
511e229ee7 WIP 2025-02-19 14:54:08 +01:00
Antonio Scandurra
9c2acc16c8 WIP 2025-02-19 14:43:05 +01:00

View File

@@ -455,14 +455,7 @@ vertex PathRasterizationVertexOutput path_rasterization_vertex(
fragment float4 path_rasterization_fragment(PathRasterizationFragmentInput input
[[stage_in]]) {
float2 dx = dfdx(input.st_position);
float2 dy = dfdy(input.st_position);
float2 gradient = float2((2. * input.st_position.x) * dx.x - dx.y,
(2. * input.st_position.x) * dy.x - dy.y);
float f = (input.st_position.x * input.st_position.x) - input.st_position.y;
float distance = f / length(gradient);
float alpha = saturate(0.5 - distance);
return float4(alpha, 0., 0., 1.);
return float4(1., 0., 0., 1.);
}
struct PathSpriteVertexOutput {
@@ -517,7 +510,7 @@ fragment float4 path_sprite_fragment(
min_filter::linear);
float4 sample =
atlas_texture.sample(atlas_texture_sampler, input.tile_position);
float mask = 1. - abs(1. - fmod(sample.r, 2.));
float mask = sample.r;
PathSprite sprite = sprites[input.sprite_id];
Background background = sprite.color;
float4 color = fill_color(background, input.position.xy, sprite.bounds,