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 000000000..cafe2421c Binary files /dev/null and b/base/assets/cursor4x.png differ 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())) {