diff --git a/scripts/node_pixel_math/node_pixel_math.gml b/scripts/node_pixel_math/node_pixel_math.gml index 4b24c08db..92b8d05df 100644 --- a/scripts/node_pixel_math/node_pixel_math.gml +++ b/scripts/node_pixel_math/node_pixel_math.gml @@ -27,7 +27,7 @@ function Node_Pixel_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group __init_mask_modifier(2); // inputs 5, 6, _scroll = array_clone(global.node_math_scroll, 1); - array_append(_scroll, ["Less than", "Greater than"]); + array_append(_scroll, ["Less than", "Less than equal", "Greater than", "Greater than equal"]); newInput(7, nodeValue_Enum_Scroll("Operator", self, 0, _scroll)); newInput(8, nodeValue_Vec4("Operand", self, [ 0, 0, 0, 0 ])); diff --git a/shaders/sh_outline/sh_outline.fsh b/shaders/sh_outline/sh_outline.fsh index 98b8d066e..bcd53feec 100644 --- a/shaders/sh_outline/sh_outline.fsh +++ b/shaders/sh_outline/sh_outline.fsh @@ -92,8 +92,8 @@ void checkPixel(vec2 px, vec2 p) { if(side == 0 && crop_border == 1 && (txs.x < 0. || txs.x > 1. || txs.y < 0. || txs.y > 1.)) return; vec4 sam = sampleTexture( gm_BaseTexture, txs ); - if(side == 0 && sam.a > 0.) return; //inside border, skip if current pixel is filled - if(side == 1 && sam.a < 1.) return; //outside border, skip if current pixel is empty + if(side == 0 && sam.a == 1.) return; //inside border, skip if current pixel is filled + if(side == 1 && sam.a == 0.) return; //outside border, skip if current pixel is empty isOutline = true; diff --git a/shaders/sh_pixel_math/sh_pixel_math.fsh b/shaders/sh_pixel_math/sh_pixel_math.fsh index f89f6c03c..eb36ffcde 100644 --- a/shaders/sh_pixel_math/sh_pixel_math.fsh +++ b/shaders/sh_pixel_math/sh_pixel_math.fsh @@ -109,11 +109,23 @@ void main() { res.a = 1.; } else if(operator == 19) { + res.r = res.r <= op.r? 1. : 0.; + res.g = res.g <= op.g? 1. : 0.; + res.b = res.b <= op.b? 1. : 0.; + res.a = 1.; + + } else if(operator == 20) { res.r = res.r > op.r? 1. : 0.; res.g = res.g > op.g? 1. : 0.; res.b = res.b > op.b? 1. : 0.; res.a = 1.; + } else if(operator == 21) { + res.r = res.r >= op.r? 1. : 0.; + res.g = res.g >= op.g? 1. : 0.; + res.b = res.b >= op.b? 1. : 0.; + res.a = 1.; + } gl_FragColor = res;