From 614c97c290ed6c91ba715ea4c09972b66eb5a3d3 Mon Sep 17 00:00:00 2001 From: "Alexander G. Morano" Date: Thu, 14 Aug 2025 22:31:40 -0400 Subject: [PATCH] * SHAPE nodes: Polygon, Ellipse, Capsule * clean up type hints * checker2 function * cleaner defaults for meta: rgb * sdf vars explained better * rgb meta requires no defaults for use (255, 255, 255, 255) --- README.md | 8 ++++++++ glsl/shape/shape-polygon.frag | 5 +++-- node_list.json | 3 +++ pyproject.toml | 2 +- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a2f98f7..665cbb7 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,14 @@ Please consider sponsoring me if you enjoy the results of my work, code or docum ## UPDATES +**2025/08/14** @1.1.40: +* SHAPE nodes: Polygon, Ellipse, Capsule +* clean up type hints +* checker2 function +* cleaner defaults for meta: rgb +* sdf vars explained better +* rgb meta requires no defaults for use (255, 255, 255, 255) + **2025/07/13** @1.1.39: * fix for first enum not being indexed as `INT` diff --git a/glsl/shape/shape-polygon.frag b/glsl/shape/shape-polygon.frag index bdf6749..5a12194 100644 --- a/glsl/shape/shape-polygon.frag +++ b/glsl/shape/shape-polygon.frag @@ -18,7 +18,8 @@ uniform bool invert; // | invert the shape void mainImage(out vec4 fragColor, in vec2 fragCoord) { vec2 uv = fragCoord / iResolution.xy; - vec2 rotatedUV = vec_rotation(center - uv, rotate); - float d = sdf_polygon(rotatedUV, size * 0.5, sides); + vec2 rotatedUV = fract(center - uv); + rotatedUV = vec_rotation(rotatedUV - 0.5, rotate) + 0.5; + float d = sdf_polygon( rotatedUV, size, sides); fragColor = sdf_blend(d, imageA, uv, color, invert); } diff --git a/node_list.json b/node_list.json index 4236999..8357730 100644 --- a/node_list.json +++ b/node_list.json @@ -19,6 +19,9 @@ "NORMAL BLEND (JOV_GL)": "Blend two Normal maps", "PIXELATE (JOV_GL)": "Pixelate input image", "POSTERIZE (JOV_GL)": "Reduce the pixel color data range", + "SHAPE: CAPSULE (JOV_GL)": "Create an capsule with adjustable ends", + "SHAPE: ELLIPSE (JOV_GL)": "Create an ellipse (circle too)", + "SHAPE: POLYGON (JOV_GL)": "Create an polygon of 3+ sides", "SOBEL (JOV_GL)": "Finds the edges of an image", "TRANSFORM (JOV_GL)": "Move, Rotate, Scale and Tile an image" } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index b48a4a4..d4ac1f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "jovi_glsl" description = "ComfyUI Nodes that integrate GLSL shader support." -version = "1.1.39" +version = "1.1.40" license = { file = "LICENSE" } readme = "README.md" authors = [{ name = "Alexander G. Morano", email = "amorano@gmail.com" }]