From ce1a0f016db291094a9a01d93d89422589fe432b Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 17 Jan 2025 13:53:44 +0100 Subject: [PATCH] Draw 3d brush cursor procedurally --- armorlab/sources/render_path_paint.ts | 2 -- armorpaint/sources/render_path_paint.ts | 4 ---- base/assets/cursor4x.png | Bin 0 -> 16242 bytes base/shaders/cursor.frag.glsl | 12 ++++++------ base/shaders/cursor.vert.glsl | 7 +------ base/sources/pipes.ts | 2 -- base/sources/ui_base.ts | 2 +- 7 files changed, 8 insertions(+), 21 deletions(-) create mode 100755 base/assets/cursor4x.png diff --git a/armorlab/sources/render_path_paint.ts b/armorlab/sources/render_path_paint.ts index 805312cee..5299f2f61 100644 --- a/armorlab/sources/render_path_paint.ts +++ b/armorlab/sources/render_path_paint.ts @@ -189,8 +189,6 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 render_path_set_target(""); g4_set_pipeline(pipes_cursor); - let img: image_t = resource_get("cursor.k"); - g4_set_tex(pipes_cursor_tex, img); let gbuffer0: render_target_t = map_get(render_path_render_targets, "gbuffer0"); g4_set_tex_depth(pipes_cursor_gbufferd, gbuffer0._image); g4_set_float2(pipes_cursor_mouse, mx, my); diff --git a/armorpaint/sources/render_path_paint.ts b/armorpaint/sources/render_path_paint.ts index 3b58cf85b..1e70409b8 100644 --- a/armorpaint/sources/render_path_paint.ts +++ b/armorpaint/sources/render_path_paint.ts @@ -488,10 +488,6 @@ function render_path_paint_draw_cursor(mx: f32, my: f32, radius: f32, tint_r: f3 render_path_set_target(""); g4_set_pipeline(pipes_cursor); - let decal: bool = context_is_decal(); - let decal_mask: bool = context_is_decal_mask(); - let img: image_t = (decal && !decal_mask) ? context_raw.decal_image : resource_get("cursor.k"); - g4_set_tex(pipes_cursor_tex, img); let rt: render_target_t = map_get(render_path_render_targets, "gbuffer0"); let gbuffer0: image_t = rt._image; g4_set_tex_depth(pipes_cursor_gbufferd, gbuffer0); diff --git a/base/assets/cursor4x.png b/base/assets/cursor4x.png new file mode 100755 index 0000000000000000000000000000000000000000..cafe2421c3c11a214c37623fddd9ea0f836d5393 GIT binary patch literal 16242 zcmXwgcU)6V^Y11Bf^?(_NDoDnqJY%UQ6f^L2m%5&kluSsL;*zvf&$Xjs1zwm@4*5p z0@6D~dI#w>xyR?dzd!QHIa}uJ%+Aj4%zXE;iP2?7IvzRz03$|U*AxIa^auyEG|=Bx zQ11cscfw2mhA#m0Z2x{Rke+!806Jr59UT*s`<{NDzV|)71Ti`~f?htJj?QlP00{E_w=NO*Q4I-z7UO$U^6Z_=n;h)equKo49v+d-H0rj~Ln^|R@NFpsmioV=61uR3p zHa{yVs`YEjpJ{1L939FFu+Wy>74kh6fq}gUHMO(CL}Vj?1@+L=0-|9CQTB8Ug?Ul? zr7aBm5JvP%QZk^$vIEVKXWH+8<|P<5D^1J{c;P3h0UFS#$^jG_^gu2UTU$4h9Z3X_7r)hv(QTu zfIof_UF35zWjt6_8mv3{wdg9!)Qn+3B-A(el`BKSJ$jcbn8WiNamDiMvd-NBaD0>+0Lno%j@zvb#!u!m_3FBhiUDr=Y<>%)F&whV2oi+VsT5g(mT4=+DF6*|YH(}3gQo{77 z%N6b!mKpgOntN#%v@G7Fn~vqZGG|ptu+}bmRcTssEhdjm-alQrJ&F@!@V4mniyof) zT=#dKOXmG*S;t=R8>RlX>~34QJfAv`*a~D|jOK`HjdhaX&NziU<-{F$swC~|JMNx1 z?pAYI#q&#Pb1#`+dRkaXR!W9(B>kj&api^B3tmYX^ZbH$1>*(u7Mm7r<_Y0y9m2KTkM>jbErRrS zxXXgh3Ar*BM*HIwzKVTp9|{YQtV=uQtBXSy1T9e zPU3y)X2g?m_O&yUXL#SqU#&TR&(^gdB{jvWP`~h6;pL@^z-g_0Pkknl80B zeV5`dF+X)~v7JIqxwp8tyb+@j6B08pTr^xwH#MwzcjleyRn@Dl?Z4VzxA(tP$UvVT zxGKUqr&Wdr!S>{D}PkxS8FOM$rv-l zRLEz|7vWp(!>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3q+6`*@ZkRej@T{< literal 0 HcmV?d00001 diff --git a/base/shaders/cursor.frag.glsl b/base/shaders/cursor.frag.glsl index 4e535a341..2842e526e 100644 --- a/base/shaders/cursor.frag.glsl +++ b/base/shaders/cursor.frag.glsl @@ -1,15 +1,15 @@ #version 450 uniform vec3 tint; -#ifdef SPIRV -uniform sampler2D gbufferD; // vulkan unit align -#endif -uniform sampler2D tex; in vec2 tex_coord; out vec4 frag_color; void main() { - vec4 col = texture(tex, tex_coord); - frag_color = vec4((col.rgb / col.a) * tint, col.a); + float radius = 0.45; + float thickness = 0.03; + float dist = distance(tex_coord, vec2(0.5, 0.5)); + float ring = smoothstep(radius - thickness, radius, dist) - + smoothstep(radius, radius + thickness, dist); + frag_color = vec4(tint, min(ring, 0.6)); } diff --git a/base/shaders/cursor.vert.glsl b/base/shaders/cursor.vert.glsl index b3c9c6eee..bfe6c05c1 100644 --- a/base/shaders/cursor.vert.glsl +++ b/base/shaders/cursor.vert.glsl @@ -7,10 +7,6 @@ uniform vec2 tex_step; uniform float radius; uniform vec3 camera_right; uniform sampler2D gbufferD; -#ifdef HLSL -// direct3d12 unit align -uniform sampler2D texa; -#endif #ifdef HLSL in vec4 pos; @@ -21,8 +17,7 @@ out vec2 tex_coord; vec3 get_pos(vec2 uv) { #ifdef HLSL - float keep = textureLod(texa, vec2(0.0, 0.0), 0.0).r; // direct3d12 unit align - float keep2 = pos.x + nor.x; + float keep = pos.x + nor.x; #endif #ifdef GLSL diff --git a/base/sources/pipes.ts b/base/sources/pipes.ts index 3919b00f0..9f49cee5d 100644 --- a/base/sources/pipes.ts +++ b/base/sources/pipes.ts @@ -47,7 +47,6 @@ let pipes_cursor_tex_step: kinc_const_loc_t; let pipes_cursor_radius: kinc_const_loc_t; let pipes_cursor_camera_right: kinc_const_loc_t; let pipes_cursor_tint: kinc_const_loc_t; -let pipes_cursor_tex: kinc_tex_unit_t; let pipes_cursor_gbufferd: kinc_tex_unit_t; function _pipes_make_merge(red: bool, green: bool, blue: bool, alpha: bool): pipeline_t { @@ -287,6 +286,5 @@ function pipes_init() { pipes_cursor_camera_right = g4_pipeline_get_const_loc(pipes_cursor, "camera_right"); pipes_cursor_tint = g4_pipeline_get_const_loc(pipes_cursor, "tint"); pipes_cursor_gbufferd = g4_pipeline_get_tex_unit(pipes_cursor, "gbufferD"); - pipes_cursor_tex = g4_pipeline_get_tex_unit(pipes_cursor, "tex"); } } diff --git a/base/sources/ui_base.ts b/base/sources/ui_base.ts index 257c87588..fda16222c 100644 --- a/base/sources/ui_base.ts +++ b/base/sources/ui_base.ts @@ -1364,7 +1364,7 @@ function ui_base_render_cursor() { } let cursor_img: image_t = resource_get("cursor.k"); - let psize: i32 = math_floor(cursor_img.width * (context_raw.brush_radius * context_raw.brush_nodes_radius) * ui_SCALE(ui_base_ui)); + let psize: i32 = math_floor(182 * (context_raw.brush_radius * context_raw.brush_nodes_radius) * ui_SCALE(ui_base_ui)); // Clone source cursor if (context_raw.tool == workspace_tool_t.CLONE && !keyboard_down("alt") && (mouse_down() || pen_down())) {