Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
feat(cursor): redraw Pixel Candy as simple pixel art built from voxels
Claude59b4c35e42f9
diff --git a/crates/compositor/src/sculpt.rs b/crates/compositor/src/sculpt.rsindex 14f00148d..612c2c65f 100644--- a/crates/compositor/src/sculpt.rs+++ b/crates/compositor/src/sculpt.rs@@ -24,18 +24,18 @@ const ZREF_ARROW: f32 = 0.2;const ZREF_HAND: f32 = 0.185;/// Le dessous de tous les modèles, dans le prototype.const Z_LOW: f32 = 0.05;-/// Le côté d'un voxel de Pixel Candy.-const VOX: f32 = 0.07;+/// Le côté d'un cube de Pixel Candy : seize lignes font un curseur haut de 1.+const VOX: f32 = 0.0625;/// Le plus haut : les yeux de l'étoile de Star Sprout, sur la flèche comme sur la manchette.const Z_HIGH_ARROW: f32 = 0.31;const Z_HIGH_HAND: f32 = 0.4;/// Boîtes des modèles dans le prototype (x0, x1, haut). Leur hauteur est celle du sprite,/// 1 / SCULPT_SCALE : le mode 15 tient le plus grand côté de la boîte pour 1 (`sprite_size`).-/// Celles des voxels, que leur anneau violet élargit d'une cellule ; puis des thèmes cerclés, que-/// leur trait élargit et que débordent l'étoile et les feuilles (Star Sprout), les tirets du clic-/// et les calques (Pop Coral), le pouce.-const BOX_PIXEL_ARROW: [f32; 3] = [-0.1, 0.6, 0.09];-const BOX_PIXEL_HAND: [f32; 3] = [-0.38, 0.73, 0.09];+/// Celles des cubes de Pixel Candy ; puis des thèmes cerclés, que leur trait élargit et que+/// débordent l'étoile et les feuilles (Star Sprout), les tirets du clic et les calques (Pop+/// Coral), le pouce.+const BOX_PIXEL_ARROW: [f32; 3] = [-0.03, 0.72, 0.03];+const BOX_PIXEL_HAND: [f32; 3] = [-0.345, 0.72, 0.03];const BOX_INK_ARROW: [f32; 3] = [-0.08, 0.6, 0.03];const BOX_INK_HAND: [f32; 3] = [-0.36, 0.6, 0.03];const BOX_CORAL_ARROW: [f32; 3] = [-0.35, 0.6, 0.06];@@ -47,12 +47,6 @@ const BOX_SPROUT_HAND: [f32; 3] = [-0.33, 0.56, 0.03];const THEMES: [&str; 5] = ["studio-ink", "prism-glow", "pop-coral", "pixel-candy", "star-sprout"];const EXTRUDED: &str = "prism-glow";-/// Le haut de la silhouette (y du prototype) : l'anneau violet des voxels dépasse la pointe-/// d'une cellule ; les thèmes cerclés tiennent leur hotspot au bord de leur trait, comme leur PNG.-fn silhouette_top(theme: usize, _arrow: bool) -> f32 {- if THEMES[theme] == "pixel-candy" { VOX } else { 0.0 }-}-/// La boîte du modèle (x0, x1, haut) dans le prototype.fn model_box(theme: usize, arrow: bool) -> [f32; 3] {match (THEMES[theme], arrow) {@@ -87,7 +81,7 @@ pub fn sculpted_shape(name: &str) -> Option<SpriteShape> {Some(SpriteShape {size,hotspot: [-x0 * s / size[0], y1 * s],- top: (y1 - silhouette_top(theme, arrow)) * s,+ top: y1 * s,max_height: (z_high - zref) * s,thick: (zref - Z_LOW) * s,sculpt: 1 + 2 * theme as u32 + u32::from(!arrow),@@ -193,13 +187,13 @@ mod tests {}/// Les grilles de Pixel Candy, que `scripts/generate-pixel-candy-voxels.mjs` écrit dans les- /// trois shaders, y sont les mêmes ; le menthe est sur la face, l'anneau autour d'elle.+ /// trois shaders, y sont les mêmes ; chaque pixel coloré est plein, et d'une seule couleur.#[test]fn the_voxel_tables_match_in_the_three_shaders() {let hlsl = include_str!("shaders.hlsl");let metal = include_str!("shaders.metal");let wgsl = include_str!("vk_shaders/layer.wgsl");- let names = ["PIX_BODY", "PIX_MINT", "PIX_RING", "PIX_RECT_N", "PIX_GRID", "PIX_ORIGIN", "PIX_BOX", "PIX_RECT"];+ let names = ["PIX_BODY", "PIX_LINE", "PIX_HI", "PIX_SHADE", "PIX_RECT_N", "PIX_GRID", "PIX_ORIGIN", "PIX_BOX", "PIX_RECT"];for name in names {let reference = table(wgsl, name);assert!(!reference.is_empty(), "{name} vide");@@ -207,14 +201,14 @@ mod tests {assert_eq!(table(metal, name), reference, "{name} : Metal et WGSL diffèrent");}let body = table(wgsl, "PIX_BODY");- let mint = table(wgsl, "PIX_MINT");- let ring = table(wgsl, "PIX_RING");- for g in table(wgsl, "PIX_GRID").chunks(4) {- let [_, rows, b, w] = [g[0], g[1], g[2], g[3]].map(|v| v as usize);- for r in 0..rows {- let (face, green) = (body[b + r] as u32, mint[b + r] as u32);- assert_eq!(green & !face, 0, "menthe hors de la face, ligne {r}");- assert_eq!((ring[w + r + 1] as u32 >> 1) & face, 0, "anneau sur la face, ligne {r}");+ let classes = ["PIX_LINE", "PIX_HI", "PIX_SHADE"].map(|name| table(wgsl, name));+ for (i, &face) in body.iter().enumerate() {+ let mut seen = 0u32;+ for class in &classes {+ let m = class[i] as u32;+ assert_eq!(m & !(face as u32), 0, "couleur hors de la forme, ligne {i}");+ assert_eq!(m & seen, 0, "deux couleurs sur un pixel, ligne {i}");+ seen |= m;}}}diff --git a/crates/compositor/src/shaders.hlsl b/crates/compositor/src/shaders.hlslindex 26f5414f2..16c62192d 100644--- a/crates/compositor/src/shaders.hlsl+++ b/crates/compositor/src/shaders.hlsl@@ -589,11 +589,11 @@ static const float MODEL_CONTACT_ALPHA = 0.5;// 1 + 2 × thème + forme ; thèmes 0 Studio Ink, 1 Prism Glow, 2 Pop Coral, 3 Pixel Candy,// 4 Star Sprout ; formes 0 flèche, 1 main. Id des matières : 1 corps, 2 bande, calque ou// manchette, 3 tirets, calque corail ou étoile, 4 feuilles, 5 trait des thèmes cerclés (et-// yeux), 6 face des voxels, 7 anneau violet. Prism Glow n'a pas de modèle : son dessin est-// extrudé, comme un sprite (id 0).+// yeux), 6 cubes de Pixel Candy. Prism Glow n'a pas de modèle : son dessin est extrudé, comme un+// sprite (id 0).static const float SCULPT_SCALE = 0.85;static const float SCULPT_HOVER = 0.05;-static const float SCULPT_VOX = 0.07;+static const float SCULPT_VOX = 0.0625;// Hauteur, dans le prototype, du z = 0 du modèle : le dessus de la pointe de la flèche, l'axe du// bout de l'index.static const float SCULPT_ZREF_ARROW = 0.2;@@ -922,54 +922,62 @@ float2 s_rimmed(float3 p, int theme, int shape)return s_opu(r, float2(s_ellipsoid(e, float3(0.075, 0.13, 0.1)) * rs, 5.0));}-// Pixel Candy : deux grilles de voxels dessinées d'après la planche (design/cursors/3d-concept.png),-// une ligne par entier, bit c = colonne c, ligne 0 en haut. `PIX_BODY` porte la face rose,-// `PIX_MINT` ses voxels menthe ; `PIX_RING`, l'anneau violet, toute cellule vide qui touche la face-// (côtés et coins), décalé d'une ligne et d'une colonne pour tenir la ligne et la colonne -1.-// `PIX_GRID` : colonnes, lignes et début de chaque forme dans les tables ; `PIX_ORIGIN` : le coin-// haut-gauche de la cellule (0, 0) ; `PIX_BOX` (centre, demi-côtés) : la boîte de la face et de-// l'anneau ; `PIX_RECT`, bornés par `PIX_RECT_N` : les mêmes en rectangles, pour l'ombre. Tables-// générées par scripts/generate-pixel-candy-voxels.mjs, qui réécrit les trois shaders : c'est là-// qu'on redessine une grille.+// Pixel Candy est un pixel art, dessiné une fois : la même grille donne ses PNG 2D et, ici, un cube+// par pixel. Une ligne par entier, bit c = colonne c, ligne 0 en haut. `PIX_BODY` : les pixels+// pleins ; `PIX_LINE`, `PIX_HI`, `PIX_SHADE` : ceux du contour prune, du reflet rose pâle et de+// l'ombre rose foncé, le reste est rose. `PIX_GRID` : colonnes, lignes et début de chaque forme+// dans les tables ; `PIX_ORIGIN` : le coin haut-gauche du pixel (0, 0) ; `PIX_BOX` (centre,+// demi-côtés) : la boîte de la forme ; `PIX_RECT`, bornés par `PIX_RECT_N` : la forme en+// rectangles, pour l'ombre. Tables générées par scripts/generate-pixel-candy-voxels.mjs, qui+// réécrit les trois shaders et les PNG : c'est là qu'on redessine une grille.// <pixel-candy-voxels>-static const int PIX_BODY[25] = { 1, 3, 7, 15, 31, 63, 127, 31, 27, 59, 113, 96, 24, 24, 24, 24, 216, 1752, 7899, 8191, 8190, 8188, 4088, 2032, 992 };-static const int PIX_MINT[25] = { 0, 0, 0, 0, 0, 1, 1, 1, 9, 11, 17, 32, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 16, 32 };-static const int PIX_RING[29] = { 7, 13, 25, 49, 97, 193, 385, 257, 449, 201, 393, 285, 311, 480, 120, 72, 72, 72, 968, 7752, 29263, 16969, 16385, 16387, 16390, 24588, 12312, 6192, 4064 };-static const int PIX_RECT_N[3] = { 0, 12, 21 };+static const int PIX_BODY[32] = { 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 127, 247, 243, 480, 192, 48, 120, 120, 120, 504, 4088, 32760, 65534, 65535, 65535, 65534, 32766, 32764, 16380, 16376, 16376 };+static const int PIX_LINE[32] = { 1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1985, 73, 149, 147, 288, 192, 48, 72, 72, 72, 456, 3656, 29256, 37454, 32777, 32769, 32770, 16386, 16388, 8196, 8200, 16376 };+static const int PIX_HI[32] = { 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 34, 32, 64, 0, 0, 16, 16, 16, 16, 16, 16, 16, 22, 18, 4, 4, 8, 8, 16, 0 };+static const int PIX_SHADE[32] = { 0, 0, 0, 4, 8, 16, 32, 64, 128, 448, 40, 36, 64, 64, 128, 0, 0, 32, 32, 32, 32, 288, 2336, 18720, 16384, 16384, 16384, 8192, 8192, 4096, 8160, 0 };+static const int PIX_RECT_N[3] = { 0, 17, 29 };static const int4 PIX_GRID[2] = {- int4(7, 12, 0, 0),- int4(13, 13, 12, 14)+ int4(11, 16, 0, 0),+ int4(16, 16, 16, 0)};static const float2 PIX_ORIGIN[2] = {float2(0.0, 0.0),- float2(-0.28, 0.0)+ float2(-0.3125, 0.0)};static const float4 PIX_BOX[2] = {- float4(0.245, -0.42, 0.315, 0.49),- float4(0.175, -0.455, 0.525, 0.525)+ float4(0.3438, -0.5, 0.3438, 0.5),+ float4(0.1875, -0.5, 0.5, 0.5)};-static const float4 PIX_RECT[21] = {- float4(0.035, 0.035, 0.105, 0.035),- float4(0.07, -0.035, 0.14, 0.035),- float4(0.105, -0.105, 0.175, 0.035),- float4(0.14, -0.175, 0.21, 0.035),- float4(0.175, -0.245, 0.245, 0.035),- float4(0.21, -0.315, 0.28, 0.035),- float4(0.245, -0.455, 0.315, 0.105),- float4(0.21, -0.595, 0.28, 0.035),- float4(0.245, -0.7, 0.315, 0.07),- float4(0.035, -0.805, 0.105, 0.035),- float4(0.385, -0.805, 0.175, 0.035),- float4(0.42, -0.875, 0.14, 0.035),- float4(0.0, -0.07, 0.14, 0.14),- float4(0.105, -0.245, 0.245, 0.035),- float4(0.21, -0.315, 0.35, 0.035),- float4(0.175, -0.49, 0.525, 0.14),- float4(0.21, -0.665, 0.49, 0.035),- float4(0.245, -0.735, 0.455, 0.035),- float4(0.245, -0.805, 0.385, 0.035),- float4(0.245, -0.875, 0.315, 0.035),- float4(0.245, -0.945, 0.245, 0.035)+static const float4 PIX_RECT[29] = {+ float4(0.0313, -0.0313, 0.0313, 0.0313),+ float4(0.0625, -0.0938, 0.0625, 0.0313),+ float4(0.0938, -0.1563, 0.0938, 0.0313),+ float4(0.125, -0.2188, 0.125, 0.0313),+ float4(0.1563, -0.2813, 0.1563, 0.0313),+ float4(0.1875, -0.3438, 0.1875, 0.0313),+ float4(0.2188, -0.4063, 0.2188, 0.0313),+ float4(0.25, -0.4688, 0.25, 0.0313),+ float4(0.2813, -0.5313, 0.2813, 0.0313),+ float4(0.3125, -0.5938, 0.3125, 0.0313),+ float4(0.3438, -0.6563, 0.3438, 0.0313),+ float4(0.2188, -0.7188, 0.2188, 0.0313),+ float4(0.0938, -0.7813, 0.0938, 0.0313),+ float4(0.375, -0.8125, 0.125, 0.0625),+ float4(0.0625, -0.8438, 0.0625, 0.0313),+ float4(0.4375, -0.9063, 0.125, 0.0313),+ float4(0.4375, -0.9688, 0.0625, 0.0313),+ float4(0.0, -0.0313, 0.0625, 0.0313),+ float4(0.0, -0.1563, 0.125, 0.0938),+ float4(0.0625, -0.2813, 0.1875, 0.0313),+ float4(0.1563, -0.3438, 0.2813, 0.0313),+ float4(0.25, -0.4063, 0.375, 0.0313),+ float4(0.2188, -0.4688, 0.4688, 0.0313),+ float4(0.1875, -0.5625, 0.5, 0.0625),+ float4(0.2188, -0.6563, 0.4688, 0.0313),+ float4(0.1875, -0.7188, 0.4375, 0.0313),+ float4(0.2188, -0.7813, 0.4063, 0.0313),+ float4(0.1875, -0.8438, 0.375, 0.0313),+ float4(0.2188, -0.9375, 0.3438, 0.0625)};// </pixel-candy-voxels>@@ -980,27 +988,13 @@ bool s_pix_bit(int m, int c)return ((m >> clamp(c, 0, 31)) & 1) == 1;}-// La cellule (c, r) de la forme `shape`, r compté vers le bas depuis la ligne 0 : un voxel de la-// face, un voxel menthe, un bloc de l'anneau.+// Le pixel (c, r) de la forme `shape`, r compté vers le bas depuis la ligne 0, est-il plein ?bool s_pix_body(int shape, int c, int r){int4 g = PIX_GRID[shape];return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_BODY[g.z + clamp(r, 0, g.y - 1)], c);}-bool s_pix_mint(int shape, int c, int r)-{- int4 g = PIX_GRID[shape];- return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_MINT[g.z + clamp(r, 0, g.y - 1)], c);-}--bool s_pix_ring(int shape, int c, int r)-{- int4 g = PIX_GRID[shape];- return c >= -1 && c <= g.x && r >= -1 && r <= g.y- && s_pix_bit(PIX_RING[g.w + clamp(r + 1, 0, g.y + 1)], c + 1);-}-// La cellule qui contient `p` (prototype, y vers le haut).int2 s_pix_cell(float2 p, int shape){@@ -1008,42 +1002,36 @@ int2 s_pix_cell(float2 p, int shape)return int2((int)floor((p.x - o.x) / SCULPT_VOX), (int)floor((o.y - p.y) / SCULPT_VOX));}-// Chaque voxel de la face est un cube au bord à peine cassé, pour que la face lise d'un bloc ;-// l'anneau violet est en retrait de 0,03 derrière elle. Hors du voisinage 3×3, une borne : une-// cellule au moins, et jamais plus près que la boîte de la forme.+// Un cube par pixel plein, tous de même hauteur, l'arête à peine cassée pour que chaque cube se+// lise. Hors du voisinage 3×3, une borne : une cellule au moins, et jamais plus près que la boîte+// de la forme.float2 s_voxels(float3 p, int shape){float4 b = PIX_BOX[shape];float2 bq = max(abs(p.xy - b.xy) - b.zw, 0.0);float bz = max(abs(p.z - (SCULPT_HOVER + 0.07)) - 0.07, 0.0);- float far = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));- float dF = far;- float dB = far;+ float d = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));float2 o = PIX_ORIGIN[shape];int2 cell = s_pix_cell(p.xy, shape);- const float3 face = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);- const float3 ring = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.055);+ const float3 cube = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);[loop] for (int j = -1; j <= 1; j++){[loop] for (int i = -1; i <= 1; i++){int c = cell.x + i;int r = cell.y + j;- float3 q = float3(p.x - o.x - (c + 0.5) * SCULPT_VOX, p.y - o.y + (r + 0.5) * SCULPT_VOX, p.z);if (s_pix_body(shape, c, r)){- dF = min(dF, s_round_box(q - float3(0.0, 0.0, SCULPT_HOVER + 0.07), face, 0.004));- }- if (s_pix_ring(shape, c, r))- {- dB = min(dB, s_round_box(q - float3(0.0, 0.0, SCULPT_HOVER + 0.055), ring, 0.01));+ float3 q = float3(p.x - o.x - (c + 0.5) * SCULPT_VOX, p.y - o.y + (r + 0.5) * SCULPT_VOX,+ p.z - SCULPT_HOVER - 0.07);+ d = min(d, s_round_box(q, cube, 0.006));}}}- return dF < dB ? float2(dF, 6.0) : float2(dB, 7.0);+ return float2(d, 6.0);}-// Distance, dans le plan de l'écran, au contour de la face et de l'anneau.+// Distance, dans le plan de l'écran, au contour de la forme.float s_pixel_outline(float2 p, int shape){float d = 1e9;@@ -1083,8 +1071,7 @@ float sculpt_units()// Le curseur sculpté en `q` (repère du modèle) : distance et id de matière. `occ` : ce qui porte// l'ombre sur l'écran. La borne des plans d'une gemme et le champ des voxels sont de mauvaises// distances loin de la surface : la pénombre s'y strie, ou s'arrête net au bord de la boîte des-// voxels. Pixel Candy porte donc l'ombre de son contour, la face et l'anneau violet, extrudé sur-// la hauteur des voxels.+// voxels. Pixel Candy porte donc l'ombre de sa forme, extrudée sur la hauteur des cubes.float2 sculpt_eval(float3 q, bool occ){int id = sculpt_id() - 1;@@ -1216,20 +1203,16 @@ SculptMat s_mat(float3 alb, float rough, float spec, float sss, float refl)return m;}-// Couleur de face du voxel qui porte `p` (prototype) : menthe où la grille le dit, rose pâle sur-// le dessus des marches (rien au-dessus), rose dedans.+// Couleur du cube qui porte `p` (prototype) : celle de son pixel.float3 s_pixel_colour(float3 p, int shape){int2 cell = s_pix_cell(p.xy, shape);- if (s_pix_mint(shape, cell.x, cell.y))- {- return s_lin(0.30, 0.82, 0.58);- }- if (!s_pix_body(shape, cell.x, cell.y - 1))- {- return s_lin(1.0, 0.76, 0.76);- }- return s_lin(1.0, 0.40, 0.62);+ int4 g = PIX_GRID[shape];+ int row = g.z + clamp(cell.y, 0, g.y - 1);+ if (s_pix_bit(PIX_LINE[row], cell.x)) return s_lin(0.29, 0.12, 0.36);+ if (s_pix_bit(PIX_HI[row], cell.x)) return s_lin(1.0, 0.78, 0.87);+ if (s_pix_bit(PIX_SHADE[row], cell.x)) return s_lin(0.87, 0.27, 0.51);+ return s_lin(1.0, 0.435, 0.66);}// La matière `mat` (id de `sculpt_proto`) au point `p` du prototype.@@ -1261,9 +1244,8 @@ SculptMat sculpt_material(float mat, float3 p, int theme, int shape)if (mat < 4.5) return s_mat(s_lin(0.62, 0.92, 0.72), 0.3, 0.6, 0.3, 0.35);return s_mat(s_lin(0.07, 0.15, 0.33), 0.7, 0.15, 0.05, 0.08);}- if (mat < 6.5) return s_mat(s_pixel_colour(p, shape), 0.45, 0.3, 0.15, 0.12);- // L'anneau violet, mat : sous la lampe, un reflet le blanchirait.- return s_mat(s_lin(0.22, 0.13, 0.33), 0.65, 0.15, 0.05, 0.06);+ // Plastique mat : sur les faces plates des cubes, un reflet de la lampe blanchirait le prune.+ return s_mat(s_pixel_colour(p, shape), 0.65, 0.1, 0.12, 0.04);}// L'environnement du studio vu du modèle : l'écran dessous, la pièce au-dessus (z du modèle), unediff --git a/crates/compositor/src/shaders.metal b/crates/compositor/src/shaders.metalindex f50eb5a0d..01cce9358 100644--- a/crates/compositor/src/shaders.metal+++ b/crates/compositor/src/shaders.metal@@ -589,7 +589,7 @@ inline int sculpt_id(constant Layer &layer)// ---- Curseurs sculptés ---- (repère du PROTOTYPE : hauteur 1, y vers le haut, écran en z = 0)constant float SCULPT_SCALE = 0.85;constant float SCULPT_HOVER = 0.05;-constant float SCULPT_VOX = 0.07;+constant float SCULPT_VOX = 0.0625;constant float SCULPT_ZREF_ARROW = 0.2;constant float SCULPT_ZREF_HAND = 0.185;constant float SCULPT_LAMP_DIST = 1.9;@@ -869,44 +869,53 @@ static float2 s_rimmed(float3 p, int theme, int shape)// Pixel Candy : tables générées par scripts/generate-pixel-candy-voxels.mjs (cf. HLSL).// <pixel-candy-voxels>-constant int PIX_BODY[25] = { 1, 3, 7, 15, 31, 63, 127, 31, 27, 59, 113, 96, 24, 24, 24, 24, 216, 1752, 7899, 8191, 8190, 8188, 4088, 2032, 992 };-constant int PIX_MINT[25] = { 0, 0, 0, 0, 0, 1, 1, 1, 9, 11, 17, 32, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 16, 32 };-constant int PIX_RING[29] = { 7, 13, 25, 49, 97, 193, 385, 257, 449, 201, 393, 285, 311, 480, 120, 72, 72, 72, 968, 7752, 29263, 16969, 16385, 16387, 16390, 24588, 12312, 6192, 4064 };-constant int PIX_RECT_N[3] = { 0, 12, 21 };+constant int PIX_BODY[32] = { 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 127, 247, 243, 480, 192, 48, 120, 120, 120, 504, 4088, 32760, 65534, 65535, 65535, 65534, 32766, 32764, 16380, 16376, 16376 };+constant int PIX_LINE[32] = { 1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1985, 73, 149, 147, 288, 192, 48, 72, 72, 72, 456, 3656, 29256, 37454, 32777, 32769, 32770, 16386, 16388, 8196, 8200, 16376 };+constant int PIX_HI[32] = { 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 34, 32, 64, 0, 0, 16, 16, 16, 16, 16, 16, 16, 22, 18, 4, 4, 8, 8, 16, 0 };+constant int PIX_SHADE[32] = { 0, 0, 0, 4, 8, 16, 32, 64, 128, 448, 40, 36, 64, 64, 128, 0, 0, 32, 32, 32, 32, 288, 2336, 18720, 16384, 16384, 16384, 8192, 8192, 4096, 8160, 0 };+constant int PIX_RECT_N[3] = { 0, 17, 29 };constant int4 PIX_GRID[2] = {- int4(7, 12, 0, 0),- int4(13, 13, 12, 14)+ int4(11, 16, 0, 0),+ int4(16, 16, 16, 0)};constant float2 PIX_ORIGIN[2] = {float2(0.0, 0.0),- float2(-0.28, 0.0)+ float2(-0.3125, 0.0)};constant float4 PIX_BOX[2] = {- float4(0.245, -0.42, 0.315, 0.49),- float4(0.175, -0.455, 0.525, 0.525)+ float4(0.3438, -0.5, 0.3438, 0.5),+ float4(0.1875, -0.5, 0.5, 0.5)};-constant float4 PIX_RECT[21] = {- float4(0.035, 0.035, 0.105, 0.035),- float4(0.07, -0.035, 0.14, 0.035),- float4(0.105, -0.105, 0.175, 0.035),- float4(0.14, -0.175, 0.21, 0.035),- float4(0.175, -0.245, 0.245, 0.035),- float4(0.21, -0.315, 0.28, 0.035),- float4(0.245, -0.455, 0.315, 0.105),- float4(0.21, -0.595, 0.28, 0.035),- float4(0.245, -0.7, 0.315, 0.07),- float4(0.035, -0.805, 0.105, 0.035),- float4(0.385, -0.805, 0.175, 0.035),- float4(0.42, -0.875, 0.14, 0.035),- float4(0.0, -0.07, 0.14, 0.14),- float4(0.105, -0.245, 0.245, 0.035),- float4(0.21, -0.315, 0.35, 0.035),- float4(0.175, -0.49, 0.525, 0.14),- float4(0.21, -0.665, 0.49, 0.035),- float4(0.245, -0.735, 0.455, 0.035),- float4(0.245, -0.805, 0.385, 0.035),- float4(0.245, -0.875, 0.315, 0.035),- float4(0.245, -0.945, 0.245, 0.035)+constant float4 PIX_RECT[29] = {+ float4(0.0313, -0.0313, 0.0313, 0.0313),+ float4(0.0625, -0.0938, 0.0625, 0.0313),+ float4(0.0938, -0.1563, 0.0938, 0.0313),+ float4(0.125, -0.2188, 0.125, 0.0313),+ float4(0.1563, -0.2813, 0.1563, 0.0313),+ float4(0.1875, -0.3438, 0.1875, 0.0313),+ float4(0.2188, -0.4063, 0.2188, 0.0313),+ float4(0.25, -0.4688, 0.25, 0.0313),+ float4(0.2813, -0.5313, 0.2813, 0.0313),+ float4(0.3125, -0.5938, 0.3125, 0.0313),+ float4(0.3438, -0.6563, 0.3438, 0.0313),+ float4(0.2188, -0.7188, 0.2188, 0.0313),+ float4(0.0938, -0.7813, 0.0938, 0.0313),+ float4(0.375, -0.8125, 0.125, 0.0625),+ float4(0.0625, -0.8438, 0.0625, 0.0313),+ float4(0.4375, -0.9063, 0.125, 0.0313),+ float4(0.4375, -0.9688, 0.0625, 0.0313),+ float4(0.0, -0.0313, 0.0625, 0.0313),+ float4(0.0, -0.1563, 0.125, 0.0938),+ float4(0.0625, -0.2813, 0.1875, 0.0313),+ float4(0.1563, -0.3438, 0.2813, 0.0313),+ float4(0.25, -0.4063, 0.375, 0.0313),+ float4(0.2188, -0.4688, 0.4688, 0.0313),+ float4(0.1875, -0.5625, 0.5, 0.0625),+ float4(0.2188, -0.6563, 0.4688, 0.0313),+ float4(0.1875, -0.7188, 0.4375, 0.0313),+ float4(0.2188, -0.7813, 0.4063, 0.0313),+ float4(0.1875, -0.8438, 0.375, 0.0313),+ float4(0.2188, -0.9375, 0.3438, 0.0625)};// </pixel-candy-voxels>@@ -921,19 +930,6 @@ static bool s_pix_body(int shape, int c, int r)return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_BODY[g.z + clamp(r, 0, g.y - 1)], c);}-static bool s_pix_mint(int shape, int c, int r)-{- int4 g = PIX_GRID[shape];- return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_MINT[g.z + clamp(r, 0, g.y - 1)], c);-}--static bool s_pix_ring(int shape, int c, int r)-{- int4 g = PIX_GRID[shape];- return c >= -1 && c <= g.x && r >= -1 && r <= g.y- && s_pix_bit(PIX_RING[g.w + clamp(r + 1, 0, g.y + 1)], c + 1);-}-inline int2 s_pix_cell(float2 p, int shape){float2 o = PIX_ORIGIN[shape];@@ -945,31 +941,25 @@ static float2 s_voxels(float3 p, int shape)float4 b = PIX_BOX[shape];float2 bq = max(abs(p.xy - b.xy) - b.zw, 0.0);float bz = max(abs(p.z - (SCULPT_HOVER + 0.07)) - 0.07, 0.0);- float far = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));- float dF = far;- float dB = far;+ float d = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));float2 o = PIX_ORIGIN[shape];int2 cell = s_pix_cell(p.xy, shape);- const float3 face = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);- const float3 ring = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.055);+ const float3 cube = float3(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);for (int j = -1; j <= 1; j++){for (int i = -1; i <= 1; i++){int c = cell.x + i;int r = cell.y + j;- float3 q = float3(p.x - o.x - (float(c) + 0.5) * SCULPT_VOX, p.y - o.y + (float(r) + 0.5) * SCULPT_VOX, p.z);if (s_pix_body(shape, c, r)){- dF = min(dF, s_round_box(q - float3(0.0, 0.0, SCULPT_HOVER + 0.07), face, 0.004));- }- if (s_pix_ring(shape, c, r))- {- dB = min(dB, s_round_box(q - float3(0.0, 0.0, SCULPT_HOVER + 0.055), ring, 0.01));+ float3 q = float3(p.x - o.x - (float(c) + 0.5) * SCULPT_VOX, p.y - o.y + (float(r) + 0.5) * SCULPT_VOX,+ p.z - SCULPT_HOVER - 0.07);+ d = min(d, s_round_box(q, cube, 0.006));}}}- return dF < dB ? float2(dF, 6.0) : float2(dB, 7.0);+ return float2(d, 6.0);}static float s_pixel_outline(float2 p, int shape)@@ -1123,15 +1113,12 @@ inline SculptMat s_mat(float3 alb, float rough, float spec, float sss, float refstatic float3 s_pixel_colour(float3 p, int shape){int2 cell = s_pix_cell(p.xy, shape);- if (s_pix_mint(shape, cell.x, cell.y))- {- return s_lin(0.30, 0.82, 0.58);- }- if (!s_pix_body(shape, cell.x, cell.y - 1))- {- return s_lin(1.0, 0.76, 0.76);- }- return s_lin(1.0, 0.40, 0.62);+ int4 g = PIX_GRID[shape];+ int row = g.z + clamp(cell.y, 0, g.y - 1);+ if (s_pix_bit(PIX_LINE[row], cell.x)) return s_lin(0.29, 0.12, 0.36);+ if (s_pix_bit(PIX_HI[row], cell.x)) return s_lin(1.0, 0.78, 0.87);+ if (s_pix_bit(PIX_SHADE[row], cell.x)) return s_lin(0.87, 0.27, 0.51);+ return s_lin(1.0, 0.435, 0.66);}static SculptMat sculpt_material(float mat, float3 p, int theme, int shape)@@ -1157,8 +1144,7 @@ static SculptMat sculpt_material(float mat, float3 p, int theme, int shape)if (mat < 4.5) return s_mat(s_lin(0.62, 0.92, 0.72), 0.3, 0.6, 0.3, 0.35);return s_mat(s_lin(0.07, 0.15, 0.33), 0.7, 0.15, 0.05, 0.08);}- if (mat < 6.5) return s_mat(s_pixel_colour(p, shape), 0.45, 0.3, 0.15, 0.12);- return s_mat(s_lin(0.22, 0.13, 0.33), 0.65, 0.15, 0.05, 0.06);+ return s_mat(s_pixel_colour(p, shape), 0.65, 0.1, 0.12, 0.04);}static float3 model_env(float3 d, float rough, float3 l, float3 fill)diff --git a/crates/compositor/src/vk_shaders/layer.wgsl b/crates/compositor/src/vk_shaders/layer.wgslindex c0cc443c9..a1a84f6ac 100644--- a/crates/compositor/src/vk_shaders/layer.wgsl+++ b/crates/compositor/src/vk_shaders/layer.wgsl@@ -609,7 +609,7 @@ fn sculpt_id() -> i32 {// ---- Curseurs sculptes ---- (repere du PROTOTYPE : hauteur 1, y vers le haut, ecran en z = 0)const SCULPT_SCALE: f32 = 0.85;const SCULPT_HOVER: f32 = 0.05;-const SCULPT_VOX: f32 = 0.07;+const SCULPT_VOX: f32 = 0.0625;const SCULPT_ZREF_ARROW: f32 = 0.2;const SCULPT_ZREF_HAND: f32 = 0.185;const SCULPT_LAMP_DIST: f32 = 1.9;@@ -863,44 +863,53 @@ fn s_rimmed(p: vec3<f32>, theme: i32, shape: i32) -> vec2<f32> {// Pixel Candy : tables générées par scripts/generate-pixel-candy-voxels.mjs (cf. HLSL).// <pixel-candy-voxels>-const PIX_BODY = array<i32, 25>(1, 3, 7, 15, 31, 63, 127, 31, 27, 59, 113, 96, 24, 24, 24, 24, 216, 1752, 7899, 8191, 8190, 8188, 4088, 2032, 992);-const PIX_MINT = array<i32, 25>(0, 0, 0, 0, 0, 1, 1, 1, 9, 11, 17, 32, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 8, 16, 32);-const PIX_RING = array<i32, 29>(7, 13, 25, 49, 97, 193, 385, 257, 449, 201, 393, 285, 311, 480, 120, 72, 72, 72, 968, 7752, 29263, 16969, 16385, 16387, 16390, 24588, 12312, 6192, 4064);-const PIX_RECT_N = array<i32, 3>(0, 12, 21);+const PIX_BODY = array<i32, 32>(1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 127, 247, 243, 480, 192, 48, 120, 120, 120, 504, 4088, 32760, 65534, 65535, 65535, 65534, 32766, 32764, 16380, 16376, 16376);+const PIX_LINE = array<i32, 32>(1, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1985, 73, 149, 147, 288, 192, 48, 72, 72, 72, 456, 3656, 29256, 37454, 32777, 32769, 32770, 16386, 16388, 8196, 8200, 16376);+const PIX_HI = array<i32, 32>(0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 18, 34, 32, 64, 0, 0, 16, 16, 16, 16, 16, 16, 16, 22, 18, 4, 4, 8, 8, 16, 0);+const PIX_SHADE = array<i32, 32>(0, 0, 0, 4, 8, 16, 32, 64, 128, 448, 40, 36, 64, 64, 128, 0, 0, 32, 32, 32, 32, 288, 2336, 18720, 16384, 16384, 16384, 8192, 8192, 4096, 8160, 0);+const PIX_RECT_N = array<i32, 3>(0, 17, 29);const PIX_GRID = array<vec4<i32>, 2>(- vec4<i32>(7, 12, 0, 0),- vec4<i32>(13, 13, 12, 14)+ vec4<i32>(11, 16, 0, 0),+ vec4<i32>(16, 16, 16, 0));const PIX_ORIGIN = array<vec2<f32>, 2>(vec2<f32>(0.0, 0.0),- vec2<f32>(-0.28, 0.0)+ vec2<f32>(-0.3125, 0.0));const PIX_BOX = array<vec4<f32>, 2>(- vec4<f32>(0.245, -0.42, 0.315, 0.49),- vec4<f32>(0.175, -0.455, 0.525, 0.525)+ vec4<f32>(0.3438, -0.5, 0.3438, 0.5),+ vec4<f32>(0.1875, -0.5, 0.5, 0.5));-const PIX_RECT = array<vec4<f32>, 21>(- vec4<f32>(0.035, 0.035, 0.105, 0.035),- vec4<f32>(0.07, -0.035, 0.14, 0.035),- vec4<f32>(0.105, -0.105, 0.175, 0.035),- vec4<f32>(0.14, -0.175, 0.21, 0.035),- vec4<f32>(0.175, -0.245, 0.245, 0.035),- vec4<f32>(0.21, -0.315, 0.28, 0.035),- vec4<f32>(0.245, -0.455, 0.315, 0.105),- vec4<f32>(0.21, -0.595, 0.28, 0.035),- vec4<f32>(0.245, -0.7, 0.315, 0.07),- vec4<f32>(0.035, -0.805, 0.105, 0.035),- vec4<f32>(0.385, -0.805, 0.175, 0.035),- vec4<f32>(0.42, -0.875, 0.14, 0.035),- vec4<f32>(0.0, -0.07, 0.14, 0.14),- vec4<f32>(0.105, -0.245, 0.245, 0.035),- vec4<f32>(0.21, -0.315, 0.35, 0.035),- vec4<f32>(0.175, -0.49, 0.525, 0.14),- vec4<f32>(0.21, -0.665, 0.49, 0.035),- vec4<f32>(0.245, -0.735, 0.455, 0.035),- vec4<f32>(0.245, -0.805, 0.385, 0.035),- vec4<f32>(0.245, -0.875, 0.315, 0.035),- vec4<f32>(0.245, -0.945, 0.245, 0.035)+const PIX_RECT = array<vec4<f32>, 29>(+ vec4<f32>(0.0313, -0.0313, 0.0313, 0.0313),+ vec4<f32>(0.0625, -0.0938, 0.0625, 0.0313),+ vec4<f32>(0.0938, -0.1563, 0.0938, 0.0313),+ vec4<f32>(0.125, -0.2188, 0.125, 0.0313),+ vec4<f32>(0.1563, -0.2813, 0.1563, 0.0313),+ vec4<f32>(0.1875, -0.3438, 0.1875, 0.0313),+ vec4<f32>(0.2188, -0.4063, 0.2188, 0.0313),+ vec4<f32>(0.25, -0.4688, 0.25, 0.0313),+ vec4<f32>(0.2813, -0.5313, 0.2813, 0.0313),+ vec4<f32>(0.3125, -0.5938, 0.3125, 0.0313),+ vec4<f32>(0.3438, -0.6563, 0.3438, 0.0313),+ vec4<f32>(0.2188, -0.7188, 0.2188, 0.0313),+ vec4<f32>(0.0938, -0.7813, 0.0938, 0.0313),+ vec4<f32>(0.375, -0.8125, 0.125, 0.0625),+ vec4<f32>(0.0625, -0.8438, 0.0625, 0.0313),+ vec4<f32>(0.4375, -0.9063, 0.125, 0.0313),+ vec4<f32>(0.4375, -0.9688, 0.0625, 0.0313),+ vec4<f32>(0.0, -0.0313, 0.0625, 0.0313),+ vec4<f32>(0.0, -0.1563, 0.125, 0.0938),+ vec4<f32>(0.0625, -0.2813, 0.1875, 0.0313),+ vec4<f32>(0.1563, -0.3438, 0.2813, 0.0313),+ vec4<f32>(0.25, -0.4063, 0.375, 0.0313),+ vec4<f32>(0.2188, -0.4688, 0.4688, 0.0313),+ vec4<f32>(0.1875, -0.5625, 0.5, 0.0625),+ vec4<f32>(0.2188, -0.6563, 0.4688, 0.0313),+ vec4<f32>(0.1875, -0.7188, 0.4375, 0.0313),+ vec4<f32>(0.2188, -0.7813, 0.4063, 0.0313),+ vec4<f32>(0.1875, -0.8438, 0.375, 0.0313),+ vec4<f32>(0.2188, -0.9375, 0.3438, 0.0625));// </pixel-candy-voxels>@@ -913,16 +922,6 @@ fn s_pix_body(shape: i32, c: i32, r: i32) -> bool {return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_BODY[g.z + clamp(r, 0, g.y - 1)], c);}-fn s_pix_mint(shape: i32, c: i32, r: i32) -> bool {- let g = PIX_GRID[shape];- return c >= 0 && c < g.x && r >= 0 && r < g.y && s_pix_bit(PIX_MINT[g.z + clamp(r, 0, g.y - 1)], c);-}--fn s_pix_ring(shape: i32, c: i32, r: i32) -> bool {- let g = PIX_GRID[shape];- return c >= -1 && c <= g.x && r >= -1 && r <= g.y && s_pix_bit(PIX_RING[g.w + clamp(r + 1, 0, g.y + 1)], c + 1);-}-fn s_pix_cell(p: vec2<f32>, shape: i32) -> vec2<i32> {let o = PIX_ORIGIN[shape];return vec2<i32>(i32(floor((p.x - o.x) / SCULPT_VOX)), i32(floor((o.y - p.y) / SCULPT_VOX)));@@ -932,27 +931,22 @@ fn s_voxels(p: vec3<f32>, shape: i32) -> vec2<f32> {let b = PIX_BOX[shape];let bq = max(abs(p.xy - b.xy) - b.zw, vec2<f32>(0.0));let bz = max(abs(p.z - (SCULPT_HOVER + 0.07)) - 0.07, 0.0);- let far = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));- var dF = far;- var dB = far;+ var d = max(SCULPT_VOX, sqrt(dot(bq, bq) + bz * bz));let o = PIX_ORIGIN[shape];let cell = s_pix_cell(p.xy, shape);- let face = vec3<f32>(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);- let ring = vec3<f32>(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.055);+ let cube = vec3<f32>(0.5 * SCULPT_VOX, 0.5 * SCULPT_VOX, 0.07);for (var j = -1; j <= 1; j++) {for (var i = -1; i <= 1; i++) {let c = cell.x + i;let r = cell.y + j;- let q = vec3<f32>(p.x - o.x - (f32(c) + 0.5) * SCULPT_VOX, p.y - o.y + (f32(r) + 0.5) * SCULPT_VOX, p.z);if s_pix_body(shape, c, r) {- dF = min(dF, s_round_box(q - vec3<f32>(0.0, 0.0, SCULPT_HOVER + 0.07), face, 0.004));- }- if s_pix_ring(shape, c, r) {- dB = min(dB, s_round_box(q - vec3<f32>(0.0, 0.0, SCULPT_HOVER + 0.055), ring, 0.01));+ let q = vec3<f32>(p.x - o.x - (f32(c) + 0.5) * SCULPT_VOX, p.y - o.y + (f32(r) + 0.5) * SCULPT_VOX,+ p.z - SCULPT_HOVER - 0.07);+ d = min(d, s_round_box(q, cube, 0.006));}}}- return select(vec2<f32>(dB, 7.0), vec2<f32>(dF, 6.0), dF < dB);+ return vec2<f32>(d, 6.0);}fn s_pixel_outline(p: vec2<f32>, shape: i32) -> f32 {@@ -1073,13 +1067,18 @@ struct SculptMat {fn s_pixel_colour(p: vec3<f32>, shape: i32) -> vec3<f32> {let cell = s_pix_cell(p.xy, shape);- if s_pix_mint(shape, cell.x, cell.y) {- return s_lin(0.30, 0.82, 0.58);+ let g = PIX_GRID[shape];+ let row = g.z + clamp(cell.y, 0, g.y - 1);+ if s_pix_bit(PIX_LINE[row], cell.x) {+ return s_lin(0.29, 0.12, 0.36);}- if !s_pix_body(shape, cell.x, cell.y - 1) {- return s_lin(1.0, 0.76, 0.76);+ if s_pix_bit(PIX_HI[row], cell.x) {+ return s_lin(1.0, 0.78, 0.87);}- return s_lin(1.0, 0.40, 0.62);+ if s_pix_bit(PIX_SHADE[row], cell.x) {+ return s_lin(0.87, 0.27, 0.51);+ }+ return s_lin(1.0, 0.435, 0.66);}fn sculpt_material(mat: f32, p: vec3<f32>, theme: i32, shape: i32) -> SculptMat {@@ -1117,10 +1116,7 @@ fn sculpt_material(mat: f32, p: vec3<f32>, theme: i32, shape: i32) -> SculptMat}return SculptMat(s_lin(0.07, 0.15, 0.33), 0.7, 0.15, 0.05, 0.08);}- if mat < 6.5 {- return SculptMat(s_pixel_colour(p, shape), 0.45, 0.3, 0.15, 0.12);- }- return SculptMat(s_lin(0.22, 0.13, 0.33), 0.65, 0.15, 0.05, 0.06);+ return SculptMat(s_pixel_colour(p, shape), 0.65, 0.1, 0.12, 0.04);}fn model_env(d: vec3<f32>, rough: f32, l: vec3<f32>, fill: vec3<f32>) -> vec3<f32> {diff --git a/crates/compositor/tests/cursor_model_render.rs b/crates/compositor/tests/cursor_model_render.rsindex fbcc25dc9..a48105252 100644--- a/crates/compositor/tests/cursor_model_render.rs+++ b/crates/compositor/tests/cursor_model_render.rs@@ -167,7 +167,7 @@ fn cursors_dir() -> String {const SCULPTED: [(&str, [f32; 2], [f32; 2]); 4] = [("studio-ink", [6.2304, 2.0992], [12.848, 2.0704]),("pop-coral", [10.4768, 2.1792], [12.3456, 2.0]),- ("pixel-candy", [7.3664, 2.0], [13.376, 1.9264]),+ ("pixel-candy", [6.5, 2.0], [10.75, 2.0]),("star-sprout", [4.7232, 2.1152], [13.1712, 2.0384]),];diff --git a/design/cursors/3d-direction.md b/design/cursors/3d-direction.mdindex 4a2033170..782f0afb8 100644--- a/design/cursors/3d-direction.md+++ b/design/cursors/3d-direction.md@@ -15,7 +15,7 @@ compositor's beveled extrusion.| Studio Ink | Black rim, a raised ivory band, a recessed satin black field. | Ivory glove cushion in a black rim, black ridges between the fingers. || Prism Glow | No sculpted model: its faceted drawing is extruded as drawn, with a beveled edge, like the default cursors. | The same. || Pop Coral | Cut paper: flat-topped sheets, no rounded bead or gloss. A coral sheet on a navy sheet, a yellow sheet behind them offset down-left, two yellow click dashes. | A yellow sheet on a navy sheet, the navy showing between the fingers, a coral sheet behind offset down-left, two coral click dashes. |-| Pixel Candy | Voxels drawn after `3d-concept.png`: a pink face, mint voxels down the left edge and the tail, pale pink step tops, a purple ring one voxel wide set a little behind. | A voxel hand in the same colours: the index, the other fingers apart, the thumb, mint down the lower-left edge. |+| Pixel Candy | Simplified pixel art, one cube per pixel: a plum outline, a pink body with a pale highlight down the lit edge and a darker shade along the outline. The 3D model and the 2D sprite come from the same grid. | The same, a pixel hand: the index up, three knuckles apart, the thumb. || Star Sprout | Glossy mint cushion framed by the navy outline of its drawing, carrying a star with a face and two leaves. | Ivory glove cushion in the same navy frame, navy ridges between the fingers, a mint cuff and the same star. |Studio Ink, Pop Coral and Star Sprout keep their drawn outline, as indiff --git a/design/cursors/pixel-candy/source.png b/design/cursors/pixel-candy/source.pngindex 79b5c859d..daeed19be 100644Binary files a/design/cursors/pixel-candy/source.png and b/design/cursors/pixel-candy/source.png differdiff --git a/design/cursors/requirements.md b/design/cursors/requirements.mdindex 6a48bc84b..992c0d7b7 100644--- a/design/cursors/requirements.md+++ b/design/cursors/requirements.md@@ -43,7 +43,7 @@ their 3D models.| Studio Ink | Black rim, raised ivory band, recessed satin black field. | Ivory glove cushion; the black outline stays as a physical rim, with black ridges between the fingers. || Prism Glow | The faceted drawing extruded as drawn, beveled edge; no sculpted model. | The same. || Pop Coral | Cut paper: a coral sheet on a navy sheet, flat tops, matte; the yellow offset becomes a flat sheet behind; the click dashes become flat pieces. | A yellow sheet on a navy sheet, flat tops, matte; the coral offset becomes a flat sheet behind; the coral click dashes become flat pieces. |-| Pixel Candy | Keep the stepped voxel form; purple is a ring of physical blocks set behind the face, not a flat outline. | Stepped voxel fingers and palm; preserve purple as a physical ring of blocks behind the face. |+| Pixel Candy | Simplified pixel art that reads at 20 px as at full size; the 3D model is one cube per pixel of the same grid as the sprite. | A pixel hand from the same kind of grid: index, three knuckles, thumb. || Star Sprout | Puffy mint cushion; the navy outline stays as a physical rim (a navy tray and a rounded bead) around it, the star and its leaves in front, each in its own navy rim. | Puffy ivory glove in the same navy rim, with navy ridges between the fingers; separate mint cuff framed in navy; the star and leaves in front, as in `star-sprout/3d-reference.png`. |The 2D PNG may keep a drawn contour where it helps readability. Its contourdiff --git a/docs/3d-effects-v2.md b/docs/3d-effects-v2.mdindex 903efdaac..253b65d68 100644--- a/docs/3d-effects-v2.md+++ b/docs/3d-effects-v2.md@@ -289,7 +289,7 @@ du bord (0,48 au pire), sous 1 texel au-delà (le flou arrondit les crêtes).La flèche et la main des thèmes d'origine sont **modélisées à la main**, en fonctions dedistance signée écrites dans les trois shaders (`sculpt_proto`, `sculpt_material`) : voxels-biseautés pour Pixel Candy ; pour Studio Ink et Star Sprout des pièces qui gardent le trait de+pour Pixel Candy ; pour Studio Ink et Star Sprout des pièces qui gardent le trait deleur dessin : un plateau et un jonc de la couleur du trait, un coussin de couleur dedans(`s_rimmed`) ; pour Pop Coral les mêmes formes en papier découpé, des feuilles au dessus plat(`s_paper`). Prism Glow n'a pas de modèle : son dessin à facettes est extrudé comme tout sprite@@ -297,18 +297,17 @@ leur dessin : un plateau et un jonc de la couleur du trait, un coussin de couleula boîte, qui pose le hotspot (pointe de la flèche, bout de l'index), règle la garde au sol etborne la boîte de dessin. Emplacement du cbuffer : `trail_a` = [modèle, épaisseur sous z = 0,hauteur au-dessus, 0] (`cursor_model_cb`).-Les voxels de Pixel Candy suivent deux grilles dessinées d'après la planche-(`scripts/generate-pixel-candy-voxels.mjs`, qui les écrit de même) : la face rose et ses voxels-menthe, le dessus des marches en rose pâle, et un anneau violet d'un voxel, en retrait derrière la-face.+Pixel Candy est un pixel art dessiné une fois, en grille, dans+`scripts/generate-pixel-candy-voxels.mjs` : le script en tire ses PNG 2D et les tables des trois+shaders, un cube par pixel plein, tous de même hauteur, colorés comme leur pixel (contour prune,+rose, reflet rose pâle, ombre rose foncé).- **Éclairage**, sprites extrudés compris : une lampe proche en haut à gauche, qui met un dégradéet un reflet même sur une face plane ; une lumière d'appoint faible ; le côté ombré teinté parla matière ; occlusion ambiante, ombre propre douce vers la lampe, studio dans les reflets,liseré de Fresnel ; tone map Khronos PBR Neutral.- **Ombre sur l'écran** : celle de B.3. Les voxels donnent de mauvaises distances loin de leur- surface (champ de grille) : l'ombre de Pixel Candy vient de son contour extrudé, la face et- l'anneau violet.+ surface (champ de grille) : l'ombre de Pixel Candy vient de sa forme extrudée.- **Antialiasing** : la silhouette l'est par la marche (la distance minimale frôlée, en pixels,donne la couverture). Les bords intérieurs (deux matières, une arête, un arrondi serré, unjoint de voxels) sont suréchantillonnés : quatre sondes à un demi-pixel du point touché, dansdiff --git a/public/cursors/pixel-candy/arrow.png b/public/cursors/pixel-candy/arrow.pngindex 1efe79656..f80ba85e5 100644Binary files a/public/cursors/pixel-candy/arrow.png and b/public/cursors/pixel-candy/arrow.png differdiff --git a/public/cursors/pixel-candy/pointer.png b/public/cursors/pixel-candy/pointer.pngindex 13e181de9..432b6e285 100644Binary files a/public/cursors/pixel-candy/pointer.png and b/public/cursors/pixel-candy/pointer.png differdiff --git a/scripts/generate-original-cursor-themes.mjs b/scripts/generate-original-cursor-themes.mjsindex 678cae5ff..f9d925c35 100644--- a/scripts/generate-original-cursor-themes.mjs+++ b/scripts/generate-original-cursor-themes.mjs@@ -1,6 +1,7 @@// Prepare transparent cursor PNGs from the original raster artwork in design/cursors.// Run with `node scripts/generate-original-cursor-themes.mjs`.-// Each source PNG contains the arrow on the left and the hand on the right.+// Each source PNG contains the arrow on the left and the hand on the right. Pixel Candy is not+// here: its pixel art is a grid, and scripts/generate-pixel-candy-voxels.mjs writes its PNGs.import { mkdir, readFile, writeFile } from "node:fs/promises";import path from "node:path";@@ -27,10 +28,6 @@ const themes = [id: "pop-coral",hotspots: { arrow: [265, 58], pointer: [1245, 65] },},- {- id: "pixel-candy",- hotspots: { arrow: [273, 76], pointer: [1218, 78] },- },{id: "star-sprout",hotspots: { arrow: [210, 65], pointer: [1218, 65] },diff --git a/scripts/generate-pixel-candy-voxels.mjs b/scripts/generate-pixel-candy-voxels.mjsindex d713e91fd..a6470c9c8 100644--- a/scripts/generate-pixel-candy-voxels.mjs+++ b/scripts/generate-pixel-candy-voxels.mjs@@ -1,141 +1,240 @@-// Voxel grids of the Pixel Candy 3D cursors (mode 15, theme 3).-// Run with `node scripts/generate-pixel-candy-voxels.mjs` after changing a grid below: it rewrites-// the PIX_* tables of the three compositor shaders, between their `<pixel-candy-voxels>` markers.+// Pixel Candy, drawn once as pixel art: this grid is both the 2D cursor (its PNGs) and the 3D+// model (one cube per pixel, mode 15, theme 3).+// Run with `node scripts/generate-pixel-candy-voxels.mjs` after changing a grid below: it writes+// public/cursors/pixel-candy/{arrow,pointer}.png, design/cursors/pixel-candy/source.png, and the+// PIX_* tables of the three compositor shaders between their `<pixel-candy-voxels>` markers, then+// prints the hotspots for src/lib/cursor/cursorThemes.ts.//-// A grid is drawn after the reference sheet (design/cursors/3d-concept.png), row 0 at the top:-// `P` a pink voxel, `M` a mint one, `.` nothing. The purple ring is not drawn: it is every empty-// cell that touches a voxel, sides and corners, and stands a little behind the face. The hotspot-// (prototype origin, see crates/compositor/src/sculpt.rs) is the top-left corner of the arrow's-// first voxel and the top middle of the index.+// `O` is the plum outline, `P` the pink body, `H` its pale highlight down the lit edge, `.`+// nothing. The shade is not drawn: a body pixel with the outline right of it or under it turns+// darker pink by itself. The hotspot is the top-left corner of the arrow's first pixel and the top+// middle of the index; in the 3D prototype frame (crates/compositor/src/sculpt.rs) it is the+// origin.-import { readFile, writeFile } from "node:fs/promises";+import { mkdir, readFile, writeFile } from "node:fs/promises";import path from "node:path";import { fileURLToPath } from "node:url";+import { deflateSync } from "node:zlib";const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");const SHADERS = path.join(ROOT, "crates", "compositor", "src");-// Mirrors SCULPT_VOX in the shaders and VOX in sculpt.rs.-const VOX = 0.07;--const ARROW = {- origin: [0, 0],- grid: [- "P......",- "PP.....",- "PPP....",- "PPPP...",- "PPPPP..",- "MPPPPP.",- "MPPPPPP",- "MPPPP..",- "MP.MP..",- "MM.MPP.",- "M...MPP",- ".....MP",- ],-};+// Mirrors SCULPT_VOX in the shaders and VOX in sculpt.rs: sixteen rows make a cursor one unit tall.+const VOX = 0.0625;+// Sprite pixels per art pixel, in the 128px sprite: sixteen rows fill the 112px the other themes+// use.+const CELL = 7;+const SPRITE = 128;-const HAND = {- origin: [-4 * VOX, 0],- grid: [- "...PP........",- "...PP........",- "...PP........",- "...PP........",- "...PP.PP.....",- "...PP.PP.PP..",- "PP.PP.PP.PPPP",- "MPPPPPPPPPPPP",- ".MPPPPPPPPPPP",- "..MPPPPPPPPPP",- "...MPPPPPPPP.",- "....MPPPPPP..",- ".....MPPPP...",- ],-};+const SHAPES = [+ {+ name: "arrow",+ // Hotspot column: the left edge of the first pixel.+ hotspotColumn: 0,+ grid: [+ "O..........",+ "OO.........",+ "OHO........",+ "OHPO.......",+ "OHPPO......",+ "OHPPPO.....",+ "OHPPPPO....",+ "OHPPPPPO...",+ "OHPPPPPPO..",+ "OHPPPPPPPO.",+ "OHPPPPOOOOO",+ "OHPOHPO....",+ "OHO.OHPO...",+ "OO..OHPO...",+ ".....OHPO..",+ "......OO...",+ ],+ },+ {+ name: "pointer",+ // Between the index's two columns.+ hotspotColumn: 5,+ grid: [+ "....OO..........",+ "...OHPO.........",+ "...OHPO.........",+ "...OHPO.........",+ "...OHPOOO.......",+ "...OHPOPPOOO....",+ "...OHPOPPOPPOOO.",+ ".OOOHPOPPOPPOPPO",+ "OHHOHPPPPPPPPPPO",+ "OHPPHPPPPPPPPPPO",+ ".OHPPPPPPPPPPPPO",+ ".OHPPPPPPPPPPPO.",+ "..OHPPPPPPPPPPO.",+ "..OHPPPPPPPPPO..",+ "...OHPPPPPPPPO..",+ "...OOOOOOOOOOO..",+ ],+ },+];-const SHAPES = [ARROW, HAND];+// sRGB, in the order of the shader's colour classes.+const COLOURS = { O: [74, 31, 92], P: [255, 111, 168], H: [255, 200, 222], S: [222, 70, 130] };-function masks({ grid }) {- const cols = grid[0].length;- const rows = grid.length;- const at = (c, r) => r >= 0 && r < rows && c >= 0 && c < cols && grid[r][c] !== ".";- const body = grid.map((line) =>- [...line].reduce((m, ch, c) => (ch === "." ? m : m | (1 << c)), 0),+// The grid with its shade pixels.+function shaded(grid) {+ const at = (c, r) => grid[r]?.[c] ?? ".";+ return grid.map((row, r) =>+ [...row]+ .map((ch, c) => (ch === "P" && (at(c + 1, r) === "O" || at(c, r + 1) === "O") ? "S" : ch))+ .join(""),);- const mint = grid.map((line) =>- [...line].reduce((m, ch, c) => (ch === "M" ? m | (1 << c) : m), 0),- );- const ring = [];- for (let r = -1; r <= rows; r++) {- let m = 0;- for (let c = -1; c <= cols; c++) {- if (at(c, r)) continue;- let touches = false;- for (let j = -1; j <= 1; j++) for (let i = -1; i <= 1; i++) touches ||= at(c + i, r + j);- if (touches) m |= 1 << (c + 1);- }- ring.push(m);- }- return { cols, rows, body, mint, ring };}-// Face and ring as rectangles (centre, half size, prototype units): each row's runs, merged with-// the rows below while the run stays the same. The shadow uses their exact outline.-function rects({ origin }, { cols, rows, body, ring }) {- const full = ring.map((m, i) => m | ((i >= 1 && i <= rows ? body[i - 1] : 0) << 1));- const runs = full.map((m) => {- const out = [];- for (let c = 0; c < cols + 2; c++) {+const shapes = SHAPES.map((shape) => {+ const grid = shaded(shape.grid);+ const cols = Math.max(...grid.map((row) => row.length));+ const rows = grid.length;+ const mask = (test) =>+ grid.map((row) => [...row].reduce((m, ch, c) => (test(ch) ? m | (1 << c) : m), 0));+ return {+ ...shape,+ grid,+ cols,+ rows,+ origin: [-shape.hotspotColumn * VOX, 0],+ body: mask((ch) => ch !== "."),+ line: mask((ch) => ch === "O"),+ hi: mask((ch) => ch === "H"),+ shade: mask((ch) => ch === "S"),+ };+});++// The body as rectangles (centre, half size, prototype units): each row's runs, merged with the+// rows below while the run stays the same. The shadow uses their exact outline.+function rects(shape) {+ const open = [];+ const done = [];+ shape.body.forEach((m, r) => {+ const runs = [];+ for (let c = 0; c < shape.cols; c++) {if (!(m & (1 << c))) continue;const start = c;- while (c + 1 < cols + 2 && m & (1 << (c + 1))) c++;- out.push([start, c]);+ while (c + 1 < shape.cols && m & (1 << (c + 1))) c++;+ runs.push([start, c]);}- return out;- });- const open = [];- const done = [];- runs.forEach((row, r) => {for (const box of open.splice(0)) {- const k = row.findIndex(([a, b]) => a === box.a && b === box.b);+ const k = runs.findIndex(([a, b]) => a === box.a && b === box.b);if (k >= 0) {box.r1 = r;- row.splice(k, 1);+ runs.splice(k, 1);open.push(box);} else done.push(box);}- for (const [a, b] of row) open.push({ a, b, r0: r, r1: r });+ for (const [a, b] of runs) open.push({ a, b, r0: r, r1: r });});done.push(...open);return done.map(({ a, b, r0, r1 }) => {- const x0 = origin[0] + (a - 1) * VOX;- const x1 = origin[0] + b * VOX;- const y0 = origin[1] - (r1 - 1 + 1) * VOX;- const y1 = origin[1] - (r0 - 1) * VOX;+ const [ox, oy] = shape.origin;+ const [x0, x1] = [ox + a * VOX, ox + (b + 1) * VOX];+ const [y0, y1] = [oy - (r1 + 1) * VOX, oy - r0 * VOX];return [(x0 + x1) / 2, (y0 + y1) / 2, (x1 - x0) / 2, (y1 - y0) / 2];});}-const data = SHAPES.map((s) => ({ shape: s, ...masks(s) }));-const boxes = data.map((d) => rects(d.shape, d));-const grid = [];-let bodyAt = 0;-let ringAt = 0;-for (const d of data) {- grid.push([d.cols, d.rows, bodyAt, ringAt]);- bodyAt += d.rows;- ringAt += d.rows + 2;-}+const boxes = shapes.map(rects);const rectStarts = boxes.reduce((s, b) => [...s, s[s.length - 1] + b.length], [0]);-// Bounding box of face and ring (centre, half size), for the bound away from the grid.-const bounds = boxes.map((list) => {- const x0 = Math.min(...list.map((b) => b[0] - b[2]));- const x1 = Math.max(...list.map((b) => b[0] + b[2]));- const y0 = Math.min(...list.map((b) => b[1] - b[3]));- const y1 = Math.max(...list.map((b) => b[1] + b[3]));- return [(x0 + x1) / 2, (y0 + y1) / 2, (x1 - x0) / 2, (y1 - y0) / 2];+const grids = [];+let at = 0;+for (const s of shapes) {+ grids.push([s.cols, s.rows, at, 0]);+ at += s.rows;+}+const bounds = shapes.map(({ origin: [ox, oy], cols, rows }) => [+ ox + (cols * VOX) / 2,+ oy - (rows * VOX) / 2,+ (cols * VOX) / 2,+ (rows * VOX) / 2,+]);++// ---- PNG ----++const CRC = new Uint32Array(256).map((_, n) => {+ let c = n;+ for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1;+ return c >>> 0;});+function crc32(bytes) {+ let c = 0xffffffff;+ for (const b of bytes) c = CRC[(c ^ b) & 0xff] ^ (c >>> 8);+ return (c ^ 0xffffffff) >>> 0;+}+function chunk(type, data) {+ const out = Buffer.alloc(12 + data.length);+ out.writeUInt32BE(data.length, 0);+ out.write(type, 4, "ascii");+ data.copy(out, 8);+ out.writeUInt32BE(crc32(out.subarray(4, 8 + data.length)), 8 + data.length);+ return out;+}+function png(width, height, rgba) {+ const header = Buffer.alloc(13);+ header.writeUInt32BE(width, 0);+ header.writeUInt32BE(height, 4);+ header.set([8, 6, 0, 0, 0], 8);+ const raw = Buffer.alloc((width * 4 + 1) * height);+ for (let y = 0; y < height; y++)+ rgba.copy(raw, y * (width * 4 + 1) + 1, y * width * 4, (y + 1) * width * 4);+ return Buffer.concat([+ Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]),+ chunk("IHDR", header),+ chunk("IDAT", deflateSync(raw, { level: 9 })),+ chunk("IEND", Buffer.alloc(0)),+ ]);+}+// The grid at `cell` pixels per art pixel, its top-left at (x0, y0) of a `w` × `h` canvas.+function paint(rgba, w, shape, cell, x0, y0) {+ shape.grid.forEach((row, r) => {+ [...row].forEach((ch, c) => {+ if (ch === ".") return;+ for (let y = 0; y < cell; y++) {+ for (let x = 0; x < cell; x++) {+ const i = ((y0 + r * cell + y) * w + x0 + c * cell + x) * 4;+ rgba.set([...COLOURS[ch], 255], i);+ }+ }+ });+ });+}++const cursors = path.join(ROOT, "public", "cursors", "pixel-candy");+await mkdir(cursors, { recursive: true });+const hotspots = [];+for (const shape of shapes) {+ const x0 = Math.round((SPRITE - shape.cols * CELL) / 2);+ const y0 = Math.round((SPRITE - shape.rows * CELL) / 2);+ const rgba = Buffer.alloc(SPRITE * SPRITE * 4);+ paint(rgba, SPRITE, shape, CELL, x0, y0);+ await writeFile(path.join(cursors, `${shape.name}.png`), png(SPRITE, SPRITE, rgba));+ // On the 32-logical reference of cursorThemes.ts.+ hotspots.push([+ shape.name,+ ((x0 + shape.hotspotColumn * CELL) * 32) / SPRITE,+ (y0 * 32) / SPRITE,+ ]);+}++// The design master, arrow on the left and hand on the right, like the other themes' sources.+{+ const [w, h, cell] = [1774, 887, 40];+ const rgba = Buffer.alloc(w * h * 4);+ shapes.forEach((shape, i) => {+ const x0 = Math.round(i * (w / 2) + (w / 2 - shape.cols * cell) / 2);+ paint(rgba, w, shape, cell, x0, Math.round((h - shape.rows * cell) / 2));+ });+ await writeFile(+ path.join(ROOT, "design", "cursors", "pixel-candy", "source.png"),+ png(w, h, rgba),+ );+}++// ---- Shader tables ----const num = (v) => {const s = v.toFixed(4);@@ -150,22 +249,22 @@ function block(lang) {}[lang];const vec = (type, v) =>`${type}(${v.map((x) => (type === t.i4 ? String(x) : num(x))).join(", ")})`;- const ints = (list) => list.join(", ");const tables = [- ["PIX_BODY", "i32", data.flatMap((d) => d.body)],- ["PIX_MINT", "i32", data.flatMap((d) => d.mint)],- ["PIX_RING", "i32", data.flatMap((d) => d.ring)],- ["PIX_RECT_N", "i32", rectStarts],+ ["PIX_BODY", shapes.flatMap((s) => s.body)],+ ["PIX_LINE", shapes.flatMap((s) => s.line)],+ ["PIX_HI", shapes.flatMap((s) => s.hi)],+ ["PIX_SHADE", shapes.flatMap((s) => s.shade)],+ ["PIX_RECT_N", rectStarts],];const vectors = [- ["PIX_GRID", t.i4, grid],- ["PIX_ORIGIN", t.f2, SHAPES.map((s) => s.origin)],+ ["PIX_GRID", t.i4, grids],+ ["PIX_ORIGIN", t.f2, shapes.map((s) => s.origin)],["PIX_BOX", t.f4, bounds],["PIX_RECT", t.f4, boxes.flat()],];if (lang === "wgsl") {return [- ...tables.map(([n, ty, v]) => `const ${n} = array<${ty}, ${v.length}>(${ints(v)});`),+ ...tables.map(([n, v]) => `const ${n} = array<i32, ${v.length}>(${v.join(", ")});`),...vectors.map(([n, ty, v]) =>`const ${n} = array<${ty}, ${v.length}>(\n ${v.map((x) => vec(ty, x)).join(",\n ")}\n);`,@@ -173,9 +272,8 @@ function block(lang) {].join("\n");}const decl = lang === "hlsl" ? "static const" : "constant";- const scalar = { i32: "int" };return [- ...tables.map(([n, ty, v]) => `${decl} ${scalar[ty]} ${n}[${v.length}] = { ${ints(v)} };`),+ ...tables.map(([n, v]) => `${decl} int ${n}[${v.length}] = { ${v.join(", ")} };`),...vectors.map(([n, ty, v]) =>`${decl} ${ty} ${n}[${v.length}] = {\n ${v.map((x) => vec(ty, x)).join(",\n ")}\n};`,@@ -199,11 +297,4 @@ for (const [i, [file, lang]] of targets.entries()) {const src = sources[i].replace(marked, (_, open, close) => `${open}${block(lang)}\n${close}`);await writeFile(path.join(SHADERS, file), src);}-console.log(- data- .map(- (d, i) =>- `${["arrow", "hand"][i]}: ${d.cols}×${d.rows} voxels, ${boxes[i].length} shadow rects`,- )- .join("; "),-);+for (const [name, x, y] of hotspots) console.log(`${name}: hotspotX ${x}, hotspotY ${y}`);diff --git a/src/lib/cursor/cursorThemes.test.ts b/src/lib/cursor/cursorThemes.test.tsindex 863acb24f..c6dceb37a 100644--- a/src/lib/cursor/cursorThemes.test.ts+++ b/src/lib/cursor/cursorThemes.test.ts@@ -80,7 +80,10 @@ describe("normalizeCursorThemeId", () => {expect(sprites.text).toBe(DEFAULT_CURSOR_SPRITES.text);});- it.each([DEFAULT_CURSOR_THEME_ID, "prism-glow"])("leaves %s to the extruded sprite in 3D", (id) => {+ it.each([+ DEFAULT_CURSOR_THEME_ID,+ "prism-glow",+ ])("leaves %s to the extruded sprite in 3D", (id) => {for (const sprite of Object.values(resolveCursorSprites(id, [], true))) {expect(sprite.sculpt).toBeUndefined();}diff --git a/src/lib/cursor/cursorThemes.ts b/src/lib/cursor/cursorThemes.tsindex 01e565118..fb7cf2e11 100644--- a/src/lib/cursor/cursorThemes.ts+++ b/src/lib/cursor/cursorThemes.ts@@ -129,7 +129,8 @@ export function readCursorAsArrow(/*** Bundled cursor themes. These five packs are original OpenScreen artwork. Their raster- * masters live in design/cursors/ and are prepared by scripts/generate-original-cursor-themes.mjs.+ * masters live in design/cursors/ and are prepared by scripts/generate-original-cursor-themes.mjs,+ * except Pixel Candy's pixel art, drawn as a grid in scripts/generate-pixel-candy-voxels.mjs.* The former Sweezy packs were removed* because their terms forbid redistribution without written permission.*@@ -213,7 +214,7 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/pixel-candy/arrow.png",width: 32,height: 32,- hotspotX: 7.3664,+ hotspotX: 6.5,hotspotY: 2,sculpted: true,},@@ -221,8 +222,8 @@ export const CURSOR_THEMES: readonly CursorTheme[] = [assetPath: "cursors/pixel-candy/pointer.png",width: 32,height: 32,- hotspotX: 13.376,- hotspotY: 1.9264,+ hotspotX: 10.75,+ hotspotY: 2,sculpted: true,},},